From 8be538e9d35e907f17815e4abec226181c329420 Mon Sep 17 00:00:00 2001 From: pyrco <105293448+pyrco@users.noreply.github.com> Date: Thu, 16 Mar 2023 14:04:48 +0100 Subject: [PATCH] Move to tox4 and pure pyproject packaging (#11) (DIS-1750) --- MANIFEST.in | 2 +- pyproject.toml | 33 +++++++++++++++++++++++++-- setup.cfg | 14 ------------ setup.py | 10 --------- tox.ini | 61 +++++++++++++++++++++++--------------------------- 5 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in index 4b4dd26..9ae349b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ exclude .gitignore -exclude .github +recursive-exclude .github/ * diff --git a/pyproject.toml b/pyproject.toml index cd76551..e012202 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,29 @@ [build-system] -requires = ["setuptools>=43.0.0", "wheel", "setuptools_scm[toml]>=3.4.1"] +requires = ["setuptools>=65.5.0", "setuptools_scm[toml]>=6.4.0"] build-backend = "setuptools.build_meta" -[tool.setuptools_scm] +[project] +name = "dissect.vmfs" +description = "A Dissect module implementing a parser for the VMFS file system, used by VMware virtualization software" +readme = "README.md" +requires-python = "~=3.9" +license.text = "Affero General Public License v3" +authors = [ + {name = "Dissect Team", email = "dissect@fox-it.com"} +] +classifiers = [ + "Programming Language :: Python :: 3", +] +dependencies = [ + "dissect.cstruct>=3.0.dev,<4.0.dev", + "dissect.util>=3.0.dev,<4.0.dev", +] +dynamic = ["version"] + +[project.urls] +homepage = "https://dissect.tools" +documentation = "https://docs.dissect.tools/en/latest/projects/dissect.vmfs" +repository = "https://github.com/fox-it/dissect.vmfs" [tool.black] line-length = 120 @@ -11,3 +32,11 @@ line-length = 120 profile = "black" known_first_party = ["dissect.vmfs"] known_third_party = ["dissect"] + +[tool.setuptools] +license-files = ["LICENSE", "COPYRIGHT"] + +[tool.setuptools.packages.find] +include = ["dissect.*"] + +[tool.setuptools_scm] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 0c19b55..0000000 --- a/setup.cfg +++ /dev/null @@ -1,14 +0,0 @@ -[metadata] -author = Dissect Team -author_email = dissect@fox-it.com -url = https://github.com/fox-it/dissect.vmfs -license = Affero General Public License v3 -description = A Dissect module implementing a parser for the VMFS file system, used by VMware virtualization software -long_description = file: README.md -long_description_content_type = text/markdown -license_files = LICENSE, COPYRIGHT -classifiers = - Programming Language :: Python :: 3 - -[options] -python_requires = ~=3.9 diff --git a/setup.py b/setup.py deleted file mode 100644 index b5f1428..0000000 --- a/setup.py +++ /dev/null @@ -1,10 +0,0 @@ -from setuptools import setup - -setup( - name="dissect.vmfs", - packages=["dissect.vmfs"], - install_requires=[ - "dissect.cstruct>=3.0.dev,<4.0.dev", - "dissect.util>=3.0.dev,<4.0.dev", - ], -) diff --git a/tox.ini b/tox.ini index f2b225f..8c95722 100644 --- a/tox.ini +++ b/tox.ini @@ -1,24 +1,14 @@ [tox] envlist = lint, py3, pypy3 # This version of tox will autoprovision itself and the requirements defined in -# requires if they are not available on the host system. -minversion = 3.8.0 -# This version of virtualenv installs a pip version of at least 19.0.1 in its -# venvs. -# Requiring minimally this version of virtualenv to be available prevents the -# need of having to explicitly specify a pip>=19.0 dependency in every testenv. -# pip>=19.0 is needed to ensure the sdist build by tox (which is build -# according to PEP 517 and PEP 518 by tox versions >= 3.4.0) is also installed -# properly (according to PEP 517 and PEP 518 by pip>=19.0) in the virtualenvs. -# If the dependency is not available on the host system, and the installed tox -# version is >= 3.3.0, tox will self bootstrap an environment with the proper -# versions (including the version of tox itself). -requires = virtualenv>=16.3.0 -isolated_build = true -# Putting the dist dir in the project directory instead of in the {toxworkdir}, -# makes the sdist more easily accesible and prevents the need of rebuilding it -# for the [testenv:build] target. -distdir = {toxinidir}/dist +# requires if they are not available on the host system. This requires the +# locally installed tox to have a minimum version 3.3.0. This means the names +# of the configuration options are still according to the tox 3.x syntax. +minversion = 4.2.4 +# This version of virtualenv will install setuptools version 65.5.0 and pip +# 22.3. These versions fully support python projects defined only through a +# pyproject.toml file (PEP-517/PEP-518/PEP-621) +requires = virtualenv>=20.16.6 [testenv] deps = @@ -30,29 +20,34 @@ commands = coverage report coverage xml +[testenv:build] +package = skip +deps = + build +commands = + pyproject-build + +[testenv:fix] +package = skip +deps = + black==23.1.0 + isort==5.11.4 +commands = + black dissect tests + isort dissect tests + [testenv:lint] -# Force the Python version here, so linting will be done with the correct -# Python version. There should be no difference between the CPython and pypy -# implementations, so we pick one. -basepython = python3 +package = skip deps = black==23.1.0 flake8 flake8-black flake8-isort + isort==5.11.4 vermin commands = - flake8 dissect tests setup.py - vermin -t=3.9- --no-tips --lint dissect tests setup.py - -[testenv:build] -# Force the Python version here, so building will be done with the correct -# Python version. As the distributions are pure Python, there should be no -# difference between the CPython and pypy implementations, so we pick one. -basepython = python3 -deps = -commands = - pip wheel --no-deps -w ./dist . + flake8 dissect tests + vermin -t=3.9- --no-tips --lint dissect tests [flake8] max-line-length = 120