Skip to content

Commit 88099d4

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

File tree

7 files changed

+672
-105
lines changed

7 files changed

+672
-105
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ tasks:
5454
secrets:
5555
- type: env
5656
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
57+
name: POETRY_PYPI_TOKEN_PYPI
6258
key: password
6359

6460
# Filter github event to only necessary fields.

poetry.lock

Lines changed: 594 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 57 additions & 3 deletions
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 <[email protected]>"]
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

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

setup.py

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

tox.ini

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,47 @@ envlist = py{38,39,310,311},lint
33
minversion = 3.2
44
skip_missing_interpreters = true
55
tox_pip_extensions_ext_venv_update = true
6+
isolated_build = 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-
deps =
10-
freezegun
11-
pytest
12-
pytest-cov
13-
requests-mock
9+
allowlist_externals = poetry
10+
commands_pre = poetry install --no-ansi --with test
11+
commands = poetry run pytest -v --cache-clear --cov="{toxinidir}" --cov-config="{toxinidir}/pyproject.toml" --cov-report term-missing --basetemp="{envtmpdir}" {posargs} --disable-pytest-warnings
1412
passenv =
1513
BUILD_CACHE
1614
CI
1715
CI_*
1816
CODECOV_*
17+
POETRY_*
1918
TOXENV
2019
TRAVIS
2120
TRAVIS_*
22-
TWINE_*
2321
VCS_*
24-
usedevelop = true
22+
skip_install = true
2523

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

3529
[testenv:lint]
36-
commands =
37-
pre-commit run -a {posargs}
38-
deps =
39-
pre-commit
40-
skip_install = true
30+
allowlist_externals = pre-commit
31+
commands_pre =
32+
commands = pre-commit run -a {posargs}
4133

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

4938
[testenv:pylint]
50-
commands =
51-
pylint {posargs}
52-
deps =
53-
pylint==2.17.4
54-
usedevelop = true
39+
commands_pre = poetry install --no-ansi --with pylint
40+
commands = poetry run pylint {posargs}
5541

5642
[testenv:pypi]
43+
commands_pre = poetry install --no-ansi
5744
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
45+
poetry build
46+
poetry publish
6647

6748
[flake8]
6849
# E203, W503, and W504 are all black compat

0 commit comments

Comments
 (0)