Skip to content

Commit 3eb2bf8

Browse files
committed
Merge branch 'master' into feature/smallerDockerBaseImage
2 parents a81c2d9 + ee91306 commit 3eb2bf8

9 files changed

Lines changed: 352 additions & 62 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
git config --global user.name "Quit CI Tests"
4040
- name: Run Tests
4141
run: |
42-
poetry run coverage run -a --source=quit tests/test_app.py
4342
poetry run coverage run -a --source=quit tests/test_app.py
4443
poetry run coverage run -a --source=quit tests/test_cache.py
4544
poetry run coverage run -a --source=quit tests/test_conf.py

README.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To get the Quit Store you have three options:
2828

2929
### Installation from Source
3030

31-
Install [pip](https://pypi.python.org/pypi/pip/) and optionally [virtualenv resp. virtualenvwrapper](http://virtualenvwrapper.readthedocs.io/en/latest/install.html) (`pip install virtualenvwrapper`).
31+
Install [poetry](https://python-poetry.org/).
3232

3333
Get the Quit Store source code:
3434
```
@@ -37,14 +37,8 @@ $ cd QuitStore
3737
```
3838
If you are using virtualenvwrapper:
3939
```
40-
$ mkvirtualenv -p /usr/bin/python3 -r requirements.txt quit
41-
$ workon quit # this has to be executed befor you use quit store
42-
43-
$ deactivate # this can be used after you are done with quit and want to get back your “normal” environment
44-
```
45-
If you are not using virtualenvwrapper:
46-
```
47-
$ pip install -r requirements.txt
40+
$ poetry install
41+
$ poetry run quitstore --help
4842
```
4943

5044
### Git configuration
@@ -53,8 +47,10 @@ Configure your name and email for Git.
5347
This information will be stored in each commit you are creating with Git and the Quit Store on your system.
5448
It is relevant so people know which contribution is coming from whom. Execute the following command if you haven't done that before.
5549

56-
$ git config --global user.name "Your Name"
57-
$ git config --global user.email "you@e-mail-provider.org"
50+
```
51+
$ git config --global user.name "Your Name"
52+
$ git config --global user.email "you@e-mail-provider.org"
53+
```
5854

5955
### Start with Existing Data (Optional)
6056

@@ -88,7 +84,7 @@ $ ./quit -t /path/to/repo
8884

8985
If you have it installed from the sources:
9086
```
91-
$ quit/run.py -t /path/to/repo
87+
$ poetry run quitstore -t /path/to/repo
9288
```
9389

9490
Open your browser and go to [`http://localhost:5000/`](http://localhost:5000/).
@@ -141,6 +137,8 @@ The log level for the logfile is always extra verbose (DEBUG).
141137

142138
## Configuration File
143139

140+
*deprecated* (we plan to remove the configuration file feature)
141+
144142
If you want to work with configuration files you can create a `config.ttl` file.
145143
This configuration file consists of two parts, the store configuration and the graph configuration.
146144
The store configuration manages everything related to initializing the software, the graph configuration maps graph files to their graph IRIs.
@@ -253,6 +251,30 @@ Further options which can be set are:
253251
* `QUIT_OAUTH_CLIENT_ID` - the GitHub OAuth client id (for OAuth see also the [github docu](https://developer.github.com/apps/building-oauth-apps/authorization-options-for-oauth-apps/))
254252
* `QUIT_OAUTH_SECRET` - the GitHub OAuth secret
255253

254+
## Run the Tests
255+
256+
You need to have the quitstore installed from source, see section [Installation from Source](#installation-from-source).
257+
258+
```
259+
poetry run pytest
260+
```
261+
262+
## Troubleshooting
263+
264+
### Use on Windows with restricted permissions
265+
266+
On Windows you might not be able to download the `.exe` file directly.
267+
If so, use the `curl` command in the power shell.
268+
269+
When you start the QuitStore (e.g. with `quit.exe -t .`) it will try to open a port that is available from outside, which will require permission by the administrator user.
270+
To open the port only locally you should start the QuitStore with:
271+
272+
```
273+
quit.exe -t . -h localhost
274+
```
275+
276+
The default port is `5000` (`http://localhost:5000/`).
277+
256278
## Migrate from old Versions
257279

258280
### Update to 2018-11-20 from 2018-10-29 and older
@@ -272,7 +294,7 @@ git commit -m "Migrate from nq to nt"
272294

273295
## License
274296

275-
Copyright (C) 2017 Norman Radtke <http://aksw.org/NormanRadtke> and Natanael Arndt <http://aksw.org/NatanaelArndt>
297+
Copyright (C) 2017-2022 Norman Radtke <http://aksw.org/NormanRadtke>, Natanael Arndt <http://aksw.org/NatanaelArndt>, and contributors
276298

277299
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
278300

poetry.lock

Lines changed: 161 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ uWSGI = "^2.0.20"
1818
[tool.poetry.dev-dependencies]
1919
pylava = "^0.3.0"
2020
coveralls = "^3.3.1"
21+
pytest = "^6.2.5"
22+
pytest-cov = "^3.0.0"
2123

2224
[build-system]
2325
requires = ["poetry-core>=1.0.0"]

quit/core.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ def getDefaultBranch(self):
124124
repository_current_head = self.repository.current_head
125125
if repository_current_head:
126126
return repository_current_head
127+
try:
128+
git_config_default_branch = pygit2.Config.get_global_config()['init.defaultBranch']
129+
if git_config_default_branch:
130+
return git_config_default_branch
131+
except KeyError:
132+
pass
127133
return "master"
128134

129135
def rebuild(self):

0 commit comments

Comments
 (0)