Skip to content

Commit 51deb19

Browse files
authored
Move to tox4 and pure pyproject packaging (#15)
(DIS-1750)
1 parent 44daf17 commit 51deb19

File tree

5 files changed

+70
-72
lines changed

5 files changed

+70
-72
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
exclude .gitignore
2-
exclude .github
2+
recursive-exclude .github/ *

pyproject.toml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
11
[build-system]
2-
requires = ["setuptools>=43.0.0", "wheel", "setuptools_scm[toml]>=3.4.1"]
2+
requires = ["setuptools>=65.5.0", "setuptools_scm[toml]>=6.4.0"]
33
build-backend = "setuptools.build_meta"
44

5-
[tool.setuptools_scm]
5+
[project]
6+
name = "dissect.hypervisor"
7+
description = "A Dissect module implementing parsers for various hypervisor disk, backup and configuration files"
8+
readme = "README.md"
9+
requires-python = "~=3.9"
10+
license.text = "Affero General Public License v3"
11+
authors = [
12+
{name = "Dissect Team", email = "dissect@fox-it.com"}
13+
]
14+
classifiers = [
15+
"Programming Language :: Python :: 3",
16+
]
17+
dependencies = [
18+
"dissect.cstruct>=3.0.dev,<4.0.dev",
19+
"dissect.util>=3.0.dev,<4.0.dev",
20+
]
21+
dynamic = ["version"]
22+
23+
[project.urls]
24+
homepage = "https://dissect.tools"
25+
documentation = "https://docs.dissect.tools/en/latest/projects/dissect.hypervisor"
26+
repository = "https://github.com/fox-it/dissect.hypervisor"
27+
28+
[project.optional-dependencies]
29+
full = [
30+
"pycryptodome",
31+
"rich",
32+
]
33+
34+
[project.scripts]
35+
vma-extract = "dissect.hypervisor.tools.vma:main"
36+
envelope-decrypt = "dissect.hypervisor.tools.envelope:main"
637

738
[tool.black]
839
line-length = 120
@@ -11,3 +42,11 @@ line-length = 120
1142
profile = "black"
1243
known_first_party = ["dissect.hypervisor"]
1344
known_third_party = ["dissect"]
45+
46+
[tool.setuptools]
47+
license-files = ["LICENSE", "COPYRIGHT"]
48+
49+
[tool.setuptools.packages.find]
50+
include = ["dissect.*"]
51+
52+
[tool.setuptools_scm]

setup.cfg

Lines changed: 0 additions & 14 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

tox.ini

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
[tox]
22
envlist = lint, py3, pypy3
33
# This version of tox will autoprovision itself and the requirements defined in
4-
# requires if they are not available on the host system.
5-
minversion = 3.8.0
6-
# This version of virtualenv installs a pip version of at least 19.0.1 in its
7-
# venvs.
8-
# Requiring minimally this version of virtualenv to be available prevents the
9-
# need of having to explicitly specify a pip>=19.0 dependency in every testenv.
10-
# pip>=19.0 is needed to ensure the sdist build by tox (which is build
11-
# according to PEP 517 and PEP 518 by tox versions >= 3.4.0) is also installed
12-
# properly (according to PEP 517 and PEP 518 by pip>=19.0) in the virtualenvs.
13-
# If the dependency is not available on the host system, and the installed tox
14-
# version is >= 3.3.0, tox will self bootstrap an environment with the proper
15-
# versions (including the version of tox itself).
16-
requires = virtualenv>=16.3.0
17-
isolated_build = true
18-
# Putting the dist dir in the project directory instead of in the {toxworkdir},
19-
# makes the sdist more easily accesible and prevents the need of rebuilding it
20-
# for the [testenv:build] target.
21-
distdir = {toxinidir}/dist
4+
# requires if they are not available on the host system. This requires the
5+
# locally installed tox to have a minimum version 3.3.0. This means the names
6+
# of the configuration options are still according to the tox 3.x syntax.
7+
minversion = 4.2.4
8+
# This version of virtualenv will install setuptools version 65.5.0 and pip
9+
# 22.3. These versions fully support python projects defined only through a
10+
# pyproject.toml file (PEP-517/PEP-518/PEP-621)
11+
requires = virtualenv>=20.16.6
2212

2313
[testenv]
2414
extras = full
@@ -31,29 +21,34 @@ commands =
3121
coverage report
3222
coverage xml
3323

24+
[testenv:build]
25+
package = skip
26+
deps =
27+
build
28+
commands =
29+
pyproject-build
30+
31+
[testenv:fix]
32+
package = skip
33+
deps =
34+
black==23.1.0
35+
isort==5.11.4
36+
commands =
37+
black dissect tests
38+
isort dissect tests
39+
3440
[testenv:lint]
35-
# Force the Python version here, so linting will be done with the correct
36-
# Python version. There should be no difference between the CPython and pypy
37-
# implementations, so we pick one.
38-
basepython = python3
41+
package = skip
3942
deps =
4043
black==23.1.0
4144
flake8
4245
flake8-black
4346
flake8-isort
47+
isort==5.11.4
4448
vermin
4549
commands =
46-
flake8 dissect tests setup.py
47-
vermin -t=3.9- --no-tips --lint dissect tests setup.py
48-
49-
[testenv:build]
50-
# Force the Python version here, so building will be done with the correct
51-
# Python version. As the distributions are pure Python, there should be no
52-
# difference between the CPython and pypy implementations, so we pick one.
53-
basepython = python3
54-
deps =
55-
commands =
56-
pip wheel --no-deps -w ./dist .
50+
flake8 dissect tests
51+
vermin -t=3.9- --no-tips --lint dissect tests
5752

5853
[flake8]
5954
max-line-length = 120

0 commit comments

Comments
 (0)