diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7d48dad..4088315 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,7 +57,7 @@ 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 @@ -65,7 +65,7 @@ repos: 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 diff --git a/pyproject.toml b/pyproject.toml index 9e36c93..5b1eb90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" = "todddeluca@yahoo.com" }] +maintainers = [ + { "name" = "Sorin Sbarnea", "email" = "sorin.sbarnea@gmail.com" } +] +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 diff --git a/requirements.txt b/requirements.txt index ae8fcca..dbe1962 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 773b195..0000000 --- a/setup.cfg +++ /dev/null @@ -1,48 +0,0 @@ -[metadata] -name = python-vagrant -url = https://github.com/pycontribs/python-vagrant -project_urls = - Bug Tracker = https://github.com/pycontribs/python-vagrant/issues - CI: GitHub = https://github.com/pycontribs/python-vagrant/actions?query=workflow:gh+branch:main+event:push - Source Code = https://github.com/pycontribs/python-vagrant -description = Python bindings for interacting with Vagrant virtual machines. -long_description = file: README.md -long_description_content_type = text/markdown -author = Todd Francis DeLuca -author_email = todddeluca@yahoo.com -license = MIT -license_file = LICENSE.txt -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 - -[options] -use_scm_version = True -python_requires = >=3.8 -package_dir = - = src -packages = find: - -[options.extras_require] -test = - coverage>=6.3 - pytest-cov>=3.0.0 - pytest>=7.0.0 - pytest-plus>=0.2 - -[options.packages.find] -where = src - -[options.package_data] -vagrant = py.typed diff --git a/tox.ini b/tox.ini index 9b6e3f2..63b4594 100644 --- a/tox.ini +++ b/tox.ini @@ -37,12 +37,31 @@ 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 = @@ -50,6 +69,7 @@ deps = setenv = PIP_CONSTRAINT = /dev/null skip_install = true +commands_pre = commands = {envpython} -m pre_commit run --all-files --show-diff-on-failure {posargs:}