Skip to content

Commit

Permalink
Introduce tox instead of Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Secrus committed Jan 7, 2023
1 parent 809156b commit 4869ff2
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 38 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
build/
dist/
*.egg-info/
.tox/
.venv/
.env/
env/
venv/
.idea/
.vscode/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 0 additions & 26 deletions Makefile

This file was deleted.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions requirements/dev.txt

This file was deleted.

43 changes: 43 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4869ff2

Please sign in to comment.