diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml new file mode 100644 index 0000000..b36b38c --- /dev/null +++ b/.github/workflows/pythonapp.yml @@ -0,0 +1,40 @@ +name: Python application + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirement*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-testing.txt + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-line-length=100 --statistics + - name: Lint with mypy + run: | + mypy tracklater + - name: Test with pytest + run: | + pytest --cov=. --cov-report term + codecov + env: + CODECOV_TOKEN: 9a7b0691-eff9-49e2-89d8-15c51a8df636 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64b1963..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Disable sudo to speed up the build -sudo: false - -language: python - -python: - - "3.7" - -env: - - CODECOV_TOKEN="9a7b0691-eff9-49e2-89d8-15c51a8df636" - -cache: pip - -before_install: - - "pip install -r requirements-testing.txt" - - "export PYTHONPATH=$PYTHONPATH:$(pwd)/tracklater" - -install: pip install -e . - -before_script: - - "flake8 ." - - "mypy tracklater" - -script: pytest --cov=. --cov-report term - -after_success: - - codecov diff --git a/tracklater/settings_utils.py b/tracklater/settings_utils.py index 4a57f77..294f162 100644 --- a/tracklater/settings_utils.py +++ b/tracklater/settings_utils.py @@ -18,6 +18,7 @@ class Dummy(object): settings_wrapper: Any = Dummy() if not os.path.exists(user_config_path): + os.mkdir(appdirs.user_config_dir()) shutil.copy(os.path.join(DIRECTORY, 'example_settings.json'), user_config_path) logger.error("No user settings file! Modify the example settings created (path: %s)", user_config_path)