From 13b46932218d125fd01f1119ed52aa7fa7497136 Mon Sep 17 00:00:00 2001 From: pyrco <105293448+pyrco@users.noreply.github.com> Date: Thu, 16 Mar 2023 14:02:48 +0100 Subject: [PATCH] Move to tox4 and pure pyproject packaging (#13) (DIS-1750) --- MANIFEST.in | 2 +- pyproject.toml | 41 +++++++++++++++++++++++++++++++-- setup.cfg | 14 ------------ setup.py | 18 --------------- tox.ini | 61 +++++++++++++++++++++++--------------------------- 5 files changed, 68 insertions(+), 68 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 c06e956..197bcab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,37 @@ [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.evidence" +description = "A Dissect module implementing a parsers for various forensic evidence file containers, currently: AD1, ASDF and EWF" +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.evidence" +repository = "https://github.com/fox-it/dissect.evidence" + +[project.optional-dependencies] + +[project.scripts] +asdf-dd = "dissect.evidence.tools.asdf.dd:main" +asdf-meta = "dissect.evidence.tools.asdf.meta:main" +asdf-repair = "dissect.evidence.tools.asdf.repair:main" +asdf-verify = "dissect.evidence.tools.asdf.verify:main" [tool.black] line-length = 120 @@ -11,3 +40,11 @@ line-length = 120 profile = "black" known_first_party = ["dissect.evidence"] 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 e2f9c1a..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.evidence -license = Affero General Public License v3 -description = A Dissect module implementing a parsers for various forensic evidence file containers, currently: AD1, ASDF and EWF -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 f264ad8..0000000 --- a/setup.py +++ /dev/null @@ -1,18 +0,0 @@ -from setuptools import find_packages, setup - -setup( - name="dissect.evidence", - packages=list(map(lambda v: "dissect." + v, find_packages("dissect"))), - install_requires=[ - "dissect.cstruct>=3.0.dev,<4.0.dev", - "dissect.util>=3.0.dev,<4.0.dev", - ], - entry_points={ - "console_scripts": [ - "asdf-dd=dissect.evidence.tools.asdf.dd:main", - "asdf-meta=dissect.evidence.tools.asdf.meta:main", - "asdf-repair=dissect.evidence.tools.asdf.repair:main", - "asdf-verify=dissect.evidence.tools.asdf.verify:main", - ], - }, -) 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