diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 75771d5..17af24d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,9 @@ jobs: with: python-version: '3.x' cache: pip - cache-dependency-path: requirements/dev.txt + - name: Install tox + run: pip install tox - name: Lint - run: make lint + run: tox -e lint - name: Test - run: make test + run: tox diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6b68a7..0c52145 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,12 +18,14 @@ jobs: python-version: '3.x' cache: pip cache-dependency-path: .github/workflows/release.yml + - name: Install project + run: pip install .[dev] - name: Lint - run: make lint + run: tox -e lint - name: Test - run: make test + run: tox - name: Install build dependencies - run: pip install -U setuptools wheel build calver + run: pip install -U setuptools wheel build - name: Build run: python -m build . - name: Publish diff --git a/.gitignore b/.gitignore index fe11925..ae59162 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,10 @@ build/ dist/ *.egg-info/ +.tox/ +.venv/ +.env/ +env/ +venv/ +.idea/ +.vscode/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45a0ff5..6ca1081 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ # Contributing -How to contributing to this package. +How to contribute to this package. ## Running tests Run `make test`. This checks whether the auto-generated list of classifiers diff --git a/Makefile b/Makefile deleted file mode 100644 index 81c0d1e..0000000 --- a/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -BINDIR = $(PWD)/.state/env/bin - -.state/env/pyvenv.cfg: requirements/dev.txt - rm -rf .state/env - python -m venv .state/env - - # install/upgrade general requirements - $(BINDIR)/python -m pip install --upgrade pip setuptools wheel - - # install various types of requirements - $(BINDIR)/python -m pip install -r requirements/dev.txt - -test: .state/env/pyvenv.cfg - $(BINDIR)/python -m pip install . - $(BINDIR)/pytest - $(BINDIR)/python -m tests.lib - -lint: .state/env/pyvenv.cfg - $(BINDIR)/black --check bin setup.py src tests - $(BINDIR)/python bin/sort.py src/trove_classifiers/__init__.py - $(BINDIR)/mypy src - -reformat: .state/env/pyvenv.cfg - $(BINDIR)/black tests src - -.PHONY: build test lint reformat diff --git a/pyproject.toml b/pyproject.toml index 23542a4..0961161 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,11 @@ dynamic = ["version"] [project.urls] Homepage = "https://github.com/pypa/trove-classifiers" +[project.optional-dependencies] +dev = [ + "tox >= 4.0" +] + [tool.setuptools] package-dir = {"" = "src"} include-package-data = false diff --git a/requirements/dev.txt b/requirements/dev.txt deleted file mode 100644 index 533f3b6..0000000 --- a/requirements/dev.txt +++ /dev/null @@ -1,5 +0,0 @@ -black -jinja2 -natsort -pytest -mypy diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..57fbe1e --- /dev/null +++ b/tox.ini @@ -0,0 +1,43 @@ +[tox] +envlist = + py311 + py310 + py39 + py38 + py37 + lint + reformat + +isolated_build = true +skip_missing_interpreters = true +minversion = 4.0 + +[testenv] +description = run the tests with pytest under {envname} +passenv = + PYTEST_* +deps = + pytest >= 7.1 +commands = + pytest {posargs} + python -m tests.lib + +[testenv:lint] +description = lint the code base +skip_install = true +deps = + black >= 22.12.0 + mypy >= 0.991 + natsort >= 8.2 +commands = + black --check bin src tests + python bin/sort.py src/trove_classifiers/__init__.py + mypy src + +[testenv:reformat] +description = format the code base +skip_install = true +deps = + black >= 22.12.0 +commands = + black tests src