diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce473f0..06b20d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,20 +4,28 @@ on: [push, pull_request] jobs: lint_and_test: - runs-on: ubuntu-latest + runs-on: ${{matrix.os}} strategy: max-parallel: 4 matrix: + os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} + - name: Install system dependencies - ${{runner.os}} + if: runner.os == 'Windows' + run: | + sed -i '/disable=/a \ no-member,' .pylintrc + - name: Set up Python v${{matrix.python-version}} - ${{runner.os}} uses: actions/setup-python@v2 with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies + python-version: ${{matrix.python-version}} + cache: pip + - name: Display Python version + run: python --version + - name: Install Python dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools wheel pip install -r requirements.txt pip install -r requirements-dev.txt - name: Check formatting (black) diff --git a/Makefile b/Makefile index 11b720e..de96a1e 100644 --- a/Makefile +++ b/Makefile @@ -28,17 +28,17 @@ format: .PHONY: lint lint: + .env/bin/black \ + --line-length 120 \ + --check \ + --diff \ + gpxtrackposter tests scripts .env/bin/pylint \ gpxtrackposter tests scripts .env/bin/mypy \ gpxtrackposter tests scripts .env/bin/codespell \ README.md gpxtrackposter/*.py tests/*.py scripts/*.py - .env/bin/black \ - --line-length 120 \ - --check \ - --diff \ - gpxtrackposter tests scripts .PHONY: test test: diff --git a/setup.py b/setup.py index 9eb01ee..4674fc8 100644 --- a/setup.py +++ b/setup.py @@ -1,58 +1,63 @@ #!/usr/bin/env python3 +# Copyright 2016-2021 Florian Pigorsch & Contributors. All rights reserved. +# +# Use of this source code is governed by a MIT-style +# license that can be found in the LICENSE file. + +"""Setup GpxTrackPoster""" + import os import setuptools def _read_reqs(relpath): + """Read requirements""" fullpath = os.path.join(os.path.dirname(__file__), relpath) - with open(fullpath) as f: - return [s.strip() for s in f.readlines() - if (s.strip() and not s.startswith("#"))] + with open(fullpath, encoding="utf-8") as f: + return [s.strip() for s in f.readlines() if (s.strip() and not s.startswith("#"))] setuptools.setup( - name='gpxtrackposter', - version='0.1', + name="gpxtrackposter", + version="0.1", install_requires=_read_reqs("requirements.txt"), tests_require=_read_reqs("requirements-dev.txt"), data_files=[ - ('.', ['requirements.txt', 'requirements-dev.txt']), - ('share/locale/de_DE/LC_MESSAGES', ['locale/de_DE/LC_MESSAGES/gpxposter.mo']), - ('share/locale/fi_FI/LC_MESSAGES', ['locale/fi_FI/LC_MESSAGES/gpxposter.mo']), - ('share/locale/fr_FR/LC_MESSAGES', ['locale/fr_FR/LC_MESSAGES/gpxposter.mo']), - ('share/locale/ru_RU/LC_MESSAGES', ['locale/ru_RU/LC_MESSAGES/gpxposter.mo']), - ('share/locale/zh_CN/LC_MESSAGES', ['locale/zh_CN/LC_MESSAGES/gpxposter.mo']), + (".", ["requirements.txt", "requirements-dev.txt"]), + ("share/locale/de_DE/LC_MESSAGES", ["locale/de_DE/LC_MESSAGES/gpxposter.mo"]), + ("share/locale/fi_FI/LC_MESSAGES", ["locale/fi_FI/LC_MESSAGES/gpxposter.mo"]), + ("share/locale/fr_FR/LC_MESSAGES", ["locale/fr_FR/LC_MESSAGES/gpxposter.mo"]), + ("share/locale/ru_RU/LC_MESSAGES", ["locale/ru_RU/LC_MESSAGES/gpxposter.mo"]), + ("share/locale/zh_CN/LC_MESSAGES", ["locale/zh_CN/LC_MESSAGES/gpxposter.mo"]), ], packages=setuptools.find_packages(), entry_points={ - 'console_scripts': [ - 'create_poster = gpxtrackposter.cli:main', + "console_scripts": [ + "create_poster = gpxtrackposter.cli:main", ], }, ) -data_files=[ - ('share/locale/ar/LC_MESSAGES', ['locale/ar/LC_MESSAGES/hatta.mo']), - ('share/locale/cs/LC_MESSAGES', ['locale/cs/LC_MESSAGES/hatta.mo']), - ('share/locale/da/LC_MESSAGES', ['locale/da/LC_MESSAGES/hatta.mo']), - ('share/locale/de/LC_MESSAGES', ['locale/de/LC_MESSAGES/hatta.mo']), - ('share/locale/el/LC_MESSAGES', ['locale/el/LC_MESSAGES/hatta.mo']), - ('share/locale/es/LC_MESSAGES', ['locale/es/LC_MESSAGES/hatta.mo']), - ('share/locale/et/LC_MESSAGES', ['locale/et/LC_MESSAGES/hatta.mo']), - ('share/locale/fi/LC_MESSAGES', ['locale/fi/LC_MESSAGES/hatta.mo']), - ('share/locale/fr/LC_MESSAGES', ['locale/fr/LC_MESSAGES/hatta.mo']), - ('share/locale/hu/LC_MESSAGES', ['locale/hu/LC_MESSAGES/hatta.mo']), - ('share/locale/ja/LC_MESSAGES', ['locale/ja/LC_MESSAGES/hatta.mo']), - ('share/locale/lt/LC_MESSAGES', ['locale/lt/LC_MESSAGES/hatta.mo']), - ('share/locale/pl/LC_MESSAGES', ['locale/pl/LC_MESSAGES/hatta.mo']), - ('share/locale/ru/LC_MESSAGES', ['locale/ru/LC_MESSAGES/hatta.mo']), - ('share/locale/sv/LC_MESSAGES', ['locale/sv/LC_MESSAGES/hatta.mo']), - ('share/locale/vi/LC_MESSAGES', ['locale/vi/LC_MESSAGES/hatta.mo']), - ('share/doc/hatta/examples', [ - 'examples/hatta.fcgi', - 'examples/hatta.gzip.fcgi', - 'examples/hatta.wsgi', - 'examples/extend_parser.py' - ]), - ], \ No newline at end of file +data_files = [ + ("share/locale/ar/LC_MESSAGES", ["locale/ar/LC_MESSAGES/hatta.mo"]), + ("share/locale/cs/LC_MESSAGES", ["locale/cs/LC_MESSAGES/hatta.mo"]), + ("share/locale/da/LC_MESSAGES", ["locale/da/LC_MESSAGES/hatta.mo"]), + ("share/locale/de/LC_MESSAGES", ["locale/de/LC_MESSAGES/hatta.mo"]), + ("share/locale/el/LC_MESSAGES", ["locale/el/LC_MESSAGES/hatta.mo"]), + ("share/locale/es/LC_MESSAGES", ["locale/es/LC_MESSAGES/hatta.mo"]), + ("share/locale/et/LC_MESSAGES", ["locale/et/LC_MESSAGES/hatta.mo"]), + ("share/locale/fi/LC_MESSAGES", ["locale/fi/LC_MESSAGES/hatta.mo"]), + ("share/locale/fr/LC_MESSAGES", ["locale/fr/LC_MESSAGES/hatta.mo"]), + ("share/locale/hu/LC_MESSAGES", ["locale/hu/LC_MESSAGES/hatta.mo"]), + ("share/locale/ja/LC_MESSAGES", ["locale/ja/LC_MESSAGES/hatta.mo"]), + ("share/locale/lt/LC_MESSAGES", ["locale/lt/LC_MESSAGES/hatta.mo"]), + ("share/locale/pl/LC_MESSAGES", ["locale/pl/LC_MESSAGES/hatta.mo"]), + ("share/locale/ru/LC_MESSAGES", ["locale/ru/LC_MESSAGES/hatta.mo"]), + ("share/locale/sv/LC_MESSAGES", ["locale/sv/LC_MESSAGES/hatta.mo"]), + ("share/locale/vi/LC_MESSAGES", ["locale/vi/LC_MESSAGES/hatta.mo"]), + ( + "share/doc/hatta/examples", + ["examples/hatta.fcgi", "examples/hatta.gzip.fcgi", "examples/hatta.wsgi", "examples/extend_parser.py"], + ), +]