Skip to content

Commit

Permalink
Move to tox4 and pure pyproject packaging (#6)
Browse files Browse the repository at this point in the history
(DIS-1750)
  • Loading branch information
pyrco committed Mar 16, 2023
1 parent c215b7f commit ffea0b4
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 65 deletions.
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
exclude .gitattributes
exclude .gitignore
exclude .github
recursive-exclude .github/ *
38 changes: 35 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
[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.thumbcache"
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.thumbcache"
repository = "https://github.com/fox-it/dissect.thumbcache"

[project.scripts]
thumbcache-extract = "dissect.thumbcache.tools.extract_images:main"
thumbcache-extract-indexed = "dissect.thumbcache.tools.extract_with_index:main"

[tool.black]
line-length = 120

[tool.isort]
profile = "black"
known_third_party = ["dissect"]
known_first_party = ["dissect.thumbcache"]
known_third_party = ["dissect"]

[tool.setuptools]
license-files = ["LICENSE", "COPYRIGHT"]

[tool.setuptools.packages.find]
include = ["dissect.*"]

[tool.setuptools_scm]
12 changes: 0 additions & 12 deletions setup.cfg

This file was deleted.

16 changes: 0 additions & 16 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

0 comments on commit ffea0b4

Please sign in to comment.