diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f543590..6696275 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,18 +22,16 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: pip - cache-dependency-path: "setup.cfg" - name: Install dependencies run: | python -m pip install -U pip python -m pip install -U wheel - python -m pip install . + python -m pip install -U tox - - name: Test run + - name: Tox tests run: | - stravavis --help - stravavis tests/gpx --activities_path tests/csv + tox -e py - name: Upload output images uses: actions/upload-artifact@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8fff9f1..9bdbb5d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.4.0 + rev: v3.9.0 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black @@ -39,8 +39,23 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace + - repo: https://github.com/tox-dev/pyproject-fmt + rev: 0.13.0 + hooks: + - id: pyproject-fmt + + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.13 + hooks: + - id: validate-pyproject + + - repo: https://github.com/tox-dev/tox-ini-fmt + rev: 1.3.1 + hooks: + - id: tox-ini-fmt + - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.9-for-vscode + rev: v3.0.0 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88] diff --git a/RELEASING.md b/RELEASING.md index 31b0898..a6caf15 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -2,8 +2,6 @@ - [ ] Get `main` to the appropriate code release state. -- [ ] Update `version` in `setup.cfg` and commit and push. - * [ ] Start from a freshly cloned repo: ```bash diff --git a/pyproject.toml b/pyproject.toml index 5d7bf33..8db3f9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,62 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatch-vcs", + "hatchling", +] + +[project] +name = "stravavis" +description = "Create artistic visualisations with your exercise data" +readme = "README.md" +keywords = [ + "artistic", + "artistic visualisations", + "exercise", + "exercise data", + "strava", + "visualisation", +] +license = {text = "MIT"} +maintainers = [{name = "Hugo van Kemenade"}] +authors = [{name = "Marcus Volz"}] +requires-python = ">=3.8" +classifiers = [ + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Artistic Software", + "Topic :: Multimedia :: Graphics", + "Topic :: Scientific/Engineering :: Visualization", +] +dynamic = [ + "version", +] +dependencies = [ + "calmap", + "fit2gpx", + "gpxpy", + "matplotlib", + "pandas<2", # Pending https://github.com/MarvinT/calmap/pull/14 + "plotnine", + "rich", + "seaborn", +] +[project.urls] +Homepage = "https://github.com/marcusvolz/strava_py" +Source = "https://github.com/marcusvolz/strava_py" +[project.scripts] +stravavis = "stravavis.cli:main" + +[tool.hatch] +version.source = "vcs" + +[tool.hatch.version.raw-options] +local_scheme = "no-local-version" + [tool.isort] profile = "black" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3674149..0000000 --- a/setup.cfg +++ /dev/null @@ -1,54 +0,0 @@ -[metadata] -name = stravavis -version = 0.1.0 -description = Create artistic visualisations with your exercise data -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/marcusvolz/strava_py -author = Marcus Volz -license = MIT -license_file = LICENSE -classifiers = - Development Status :: 3 - Alpha - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Topic :: Artistic Software - Topic :: Multimedia :: Graphics - Topic :: Scientific/Engineering :: Visualization -keywords = - strava - artistic visualisations - artistic - visualisation - exercise data - exercise -project_urls = - Source=https://github.com/marcusvolz/strava_py - -[options] -packages = find: -install_requires = - calmap - fit2gpx - gpxpy - matplotlib - # Pending https://github.com/MarvinT/calmap/pull/14 - pandas<2 - plotnine - rich - seaborn -python_requires = >=3.8 -package_dir = =src -zip_safe = True - -[options.packages.find] -where = src - -[options.entry_points] -console_scripts = - stravavis = stravavis.cli:main diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..5f5dc58 --- /dev/null +++ b/tox.ini @@ -0,0 +1,22 @@ +[tox] +requires = + tox>=4.2 +env_list = + lint + py{311, 310, 39, 38} + +[testenv] +pass_env = + FORCE_COLOR +commands = + stravavis --help + stravavis tests/gpx --activities_path tests/csv + +[testenv:lint] +skip_install = true +deps = + pre-commit +pass_env = + PRE_COMMIT_COLOR +commands = + pre-commit run --all-files --show-diff-on-failure