Skip to content

Commit dce38a7

Browse files
Switch project from setuptools to poetry.
1 parent 97b8a0e commit dce38a7

7 files changed

+680
-103
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ repos:
4141
hooks:
4242
- id: codespell
4343
exclude_types: [json]
44-
exclude: ^tests/mock-+
44+
exclude: ^(tests/mock-+|poetry.lock)
4545
- repo: https://github.com/marco-c/taskcluster_yml_validator
4646
rev: v0.0.10
4747
hooks:

.taskcluster.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ tasks:
4242
TOXENV: lint
4343
script:
4444
- tox
45+
- name: build python 3.11
46+
version: "3.11"
47+
env:
48+
TOXENV: build
49+
script:
50+
- tox
4551
- name: PyPI upload
4652
version: "3.11"
4753
env:
@@ -54,11 +60,7 @@ tasks:
5460
secrets:
5561
- type: env
5662
secret: project/fuzzing/pypi-fuzzfetch
57-
name: TWINE_USERNAME
58-
key: username
59-
- type: env
60-
secret: project/fuzzing/pypi-fuzzfetch
61-
name: TWINE_PASSWORD
63+
name: POETRY_PYPI_TOKEN_PYPI
6264
key: password
6365

6466
# Filter github event to only necessary fields.

poetry.lock

+594
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+57-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["setuptools >= 43", "wheel", "setuptools_scm[toml] >= 3.4"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
3+
build-backend = "poetry_dynamic_versioning.backend"
44

55
[tool.coverage.run]
66
omit = [
@@ -46,4 +46,58 @@ disable = [
4646
[tool.pytest.ini_options]
4747
log_level = "DEBUG"
4848

49-
[tool.setuptools_scm]
49+
[tool.poetry]
50+
authors = ["Mozilla Fuzzing Team <fuzzing@mozilla.com>"]
51+
classifiers = [
52+
"Development Status :: 5 - Production/Stable",
53+
"Intended Audience :: Developers",
54+
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
55+
"Programming Language :: Python :: 3",
56+
"Topic :: Security",
57+
"Topic :: Software Development :: Testing",
58+
]
59+
description = "Downloader for firefox/jsshell builds."
60+
homepage = "https://github.com/MozillaSecurity/fuzzfetch"
61+
keywords = ["fuzz", "fuzzing", "security", "test", "testing"]
62+
license = "MPL 2.0"
63+
name = "fuzzfetch"
64+
packages = [{from = "src", include = "fuzzfetch"}]
65+
version = "0.0.0"
66+
67+
[tool.poetry.dependencies]
68+
python = "^3.8"
69+
pytz = "^2023.3.post1"
70+
requests = "^2.31.0"
71+
72+
[tool.poetry.group.test]
73+
optional = true
74+
75+
[tool.poetry.group.test.dependencies]
76+
freezegun = "^1.3.1"
77+
pytest = "^7.4.3"
78+
pytest-cov = "^4.1.0"
79+
requests-mock = "^1.11.0"
80+
81+
[tool.poetry.group.coverage]
82+
optional = true
83+
84+
[tool.poetry.group.coverage.dependencies]
85+
coverage = {version = "^7.3.2", extras = ["toml"]}
86+
87+
[tool.poetry.group.mypy]
88+
optional = true
89+
90+
[tool.poetry.group.mypy.dependencies]
91+
mypy = "^1.7.1"
92+
93+
[tool.poetry.group.pylint]
94+
optional = true
95+
96+
[tool.poetry.group.pylint.dependencies]
97+
pylint = "^3.0.2"
98+
99+
[tool.poetry.scripts]
100+
fuzzfetch = "fuzzfetch:Fetcher.main"
101+
102+
[tool.poetry-dynamic-versioning]
103+
enable = true

setup.cfg

-42
This file was deleted.

setup.py

-16
This file was deleted.

tox.ini

+21-36
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,53 @@
11
[tox]
22
envlist = py{38,39,310,311},lint
3+
isolated_build = true
34
minversion = 3.2
45
skip_missing_interpreters = true
56
tox_pip_extensions_ext_venv_update = true
67

78
[testenv]
8-
commands = pytest -v --cache-clear --cov="{toxinidir}" --cov-config="{toxinidir}/pyproject.toml" --cov-report term-missing --basetemp="{envtmpdir}" {posargs} --disable-pytest-warnings
9+
commands_pre = poetry install --no-ansi --with test
10+
commands = poetry run pytest -v --cache-clear --cov="{toxinidir}" --cov-config="{toxinidir}/pyproject.toml" --cov-report term-missing --basetemp="{envtmpdir}" {posargs} --disable-pytest-warnings
911
deps =
10-
freezegun
11-
pytest
12-
pytest-cov
13-
requests-mock
12+
poetry
13+
poetry-dynamic-versioning
1414
passenv =
1515
BUILD_CACHE
1616
CI
1717
CI_*
1818
CODECOV_*
19+
POETRY_*
1920
TOXENV
2021
TRAVIS
2122
TRAVIS_*
22-
TWINE_*
2323
VCS_*
24-
usedevelop = true
24+
skip_install = true
25+
26+
[testenv:build]
27+
commands_pre =
28+
commands = poetry build
2529

2630
[testenv:codecov]
27-
commands =
28-
codecov
29-
deps =
30-
coverage[toml]
31-
skip_install = true
32-
allowlist_externals =
33-
codecov
31+
commands_pre = poetry install --no-ansi --only coverage
32+
commands = poetry run codecov
3433

3534
[testenv:lint]
36-
commands =
37-
pre-commit run -a {posargs}
35+
commands_pre =
36+
commands = pre-commit run -a {posargs}
3837
deps =
3938
pre-commit
40-
skip_install = true
4139

4240
[testenv:mypy]
43-
commands =
44-
mypy --install-types --non-interactive {posargs}
45-
deps =
46-
mypy==v1.3.0
47-
usedevelop = true
41+
commands_pre = poetry install --no-ansi --with mypy
42+
commands = poetry run mypy --install-types --non-interactive {posargs}
4843

4944
[testenv:pylint]
50-
commands =
51-
pylint {posargs}
52-
deps =
53-
pylint==2.17.4
54-
usedevelop = true
45+
commands_pre = poetry install --no-ansi --with pylint
46+
commands = poetry run pylint {posargs}
5547

5648
[testenv:pypi]
57-
commands =
58-
python setup.py sdist bdist_wheel
59-
twine upload --skip-existing dist/*
60-
deps =
61-
setuptools>=43
62-
setuptools_scm[toml]>=3.4
63-
twine
64-
wheel
65-
skip_install = true
49+
commands_pre =
50+
commands = poetry publish --build
6651

6752
[flake8]
6853
# E203, W503, and W504 are all black compat

0 commit comments

Comments
 (0)