Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt PEP-621 #146

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ repos:
rev: 6.11.0
hooks:
- id: pip-compile
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt setup.cfg pyproject.toml --extra test --strip-extras
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt pyproject.toml --extra test --strip-extras
language: python
files: ^(requirements\.txt|pyproject\.toml)$
alias: deps
language_version: "3.9" # minimal we support officially
additional_dependencies:
- pip>=22.3.1
- id: pip-compile
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt setup.cfg pyproject.toml --extra test --strip-extras
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt pyproject.toml --extra test --strip-extras --upgrade
language: python
files: ^(requirements\.txt|pyproject\.toml)$
alias: up
Expand Down
42 changes: 38 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@
[build-system]
requires = [
"setuptools >= 45.0.0", # required by pyproject+setuptools_scm integration
"setuptools_scm >= 6.3.1", # required for "no-local-version" scheme
"setuptools_scm_git_archive >= 1.0",
"wheel",
"setuptools >= 61.0", # PEP-621
"setuptools_scm[toml] >= 7.0.0",
]
build-backend = "setuptools.build_meta"

[project]
# https://peps.python.org/pep-0621/#readme
requires-python = ">=3.8"
dynamic = ["version"]
name = "python-vagrant"
description = "Python bindings for interacting with Vagrant virtual machines."
readme = "README.md"
authors = [{ "name" = "Todd Francis DeLuca", "email" = "[email protected]" }]
maintainers = [
{ "name" = "Sorin Sbarnea", "email" = "[email protected]" }
]
license = { text = "MIT" }
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Utilities",
]
keywords = ["box", "vagrant", "vagrantfile", "virtual-machine", "virtualbox"]

[project.urls]
homepage = "https://github.com/pycontribs/python-vagrant"
repository = "https://github.com/pycontribs/python-vagrant"
changelog = "https://github.com/pycontribs/python-vagrant/releases"

[project.optional-dependencies]
test = [
"coverage>=6.3",
"pytest-cov>=3.0.0",
"pytest>=7.0.0",
"pytest-plus>=0.2",
]

[tool.coverage.run]
source = ["src"]
branch = true
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --extra=test --no-annotate --output-file=requirements.txt --resolver=backtracking --strip-extras pyproject.toml setup.cfg
# pip-compile --extra=test --no-annotate --output-file=requirements.txt --resolver=backtracking --strip-extras pyproject.toml
#
attrs==22.1.0
coverage==6.5.0
Expand Down
48 changes: 0 additions & 48 deletions setup.cfg

This file was deleted.

20 changes: 20 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,39 @@ setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
PIP_CONSTRAINT = requirements.txt
allowlist_externals =
git
sh
*/create_dummy_box.sh

[testenv:dev]
commands = {posargs}

[testenv:deps]
description = Bump all test dependencies
# we reuse the lint environment
envdir = {toxworkdir}/lint
skip_install = true
deps =
{[testenv:lint]deps}
setenv =
# without his upgrade would likely not do anything
PIP_CONSTRAINT = /dev/null
commands_pre =
commands =
pre-commit run --all-files --show-diff-on-failure --hook-stage manual up
# Update pre-commit hooks
pre-commit autoupdate
# We fail if files are modified at the end
git diff --exit-code

[testenv:lint]
description = Run all linters
deps =
pre-commit>=2.6.0
setenv =
PIP_CONSTRAINT = /dev/null
skip_install = true
commands_pre =
commands =
{envpython} -m pre_commit run --all-files --show-diff-on-failure {posargs:}

Expand Down