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

Move to tox4 and pure pyproject packaging #13

Merged
merged 1 commit into from
Mar 16, 2023
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
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
exclude .gitignore
exclude .github
recursive-exclude .github/ *
41 changes: 39 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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]
14 changes: 0 additions & 14 deletions setup.cfg

This file was deleted.

18 changes: 0 additions & 18 deletions setup.py

This file was deleted.

61 changes: 28 additions & 33 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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 =
Expand All @@ -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
Expand Down