Skip to content

Commit

Permalink
Switch project from setuptools to poetry.
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwartzentruber committed Dec 12, 2023
1 parent 97b8a0e commit ce9e948
Show file tree
Hide file tree
Showing 7 changed files with 682 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ repos:
hooks:
- id: codespell
exclude_types: [json]
exclude: ^tests/mock-+
exclude: ^(tests/mock-+|poetry.lock)
- repo: https://github.com/marco-c/taskcluster_yml_validator
rev: v0.0.10
hooks:
Expand Down
12 changes: 7 additions & 5 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ tasks:
TOXENV: lint
script:
- tox
- name: build python 3.11
version: "3.11"
env:
TOXENV: build
script:
- tox
- name: PyPI upload
version: "3.11"
env:
Expand All @@ -54,11 +60,7 @@ tasks:
secrets:
- type: env
secret: project/fuzzing/pypi-fuzzfetch
name: TWINE_USERNAME
key: username
- type: env
secret: project/fuzzing/pypi-fuzzfetch
name: TWINE_PASSWORD
name: POETRY_PYPI_TOKEN_PYPI
key: password

# Filter github event to only necessary fields.
Expand Down
594 changes: 594 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

60 changes: 57 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["setuptools >= 43", "wheel", "setuptools_scm[toml] >= 3.4"]
build-backend = "setuptools.build_meta"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.coverage.run]
omit = [
Expand Down Expand Up @@ -46,4 +46,58 @@ disable = [
[tool.pytest.ini_options]
log_level = "DEBUG"

[tool.setuptools_scm]
[tool.poetry]
authors = ["Mozilla Fuzzing Team <[email protected]>"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Programming Language :: Python :: 3",
"Topic :: Security",
"Topic :: Software Development :: Testing",
]
description = "Downloader for firefox/jsshell builds."
homepage = "https://github.com/MozillaSecurity/fuzzfetch"
keywords = ["fuzz", "fuzzing", "security", "test", "testing"]
license = "MPL 2.0"
name = "fuzzfetch"
packages = [{from = "src", include = "fuzzfetch"}]
version = "0.0.0"

[tool.poetry.dependencies]
python = "^3.8"
pytz = "^2023.3.post1"
requests = "^2.31.0"

[tool.poetry.group.test]
optional = true

[tool.poetry.group.test.dependencies]
freezegun = "^1.3.1"
pytest = "^7.4.3"
pytest-cov = "^4.1.0"
requests-mock = "^1.11.0"

[tool.poetry.group.coverage]
optional = true

[tool.poetry.group.coverage.dependencies]
coverage = {version = "^7.3.2", extras = ["toml"]}

[tool.poetry.group.mypy]
optional = true

[tool.poetry.group.mypy.dependencies]
mypy = "^1.7.1"

[tool.poetry.group.pylint]
optional = true

[tool.poetry.group.pylint.dependencies]
pylint = "^3.0.2"

[tool.poetry.scripts]
fuzzfetch = "fuzzfetch:Fetcher.main"

[tool.poetry-dynamic-versioning]
enable = true
42 changes: 0 additions & 42 deletions setup.cfg

This file was deleted.

16 changes: 0 additions & 16 deletions setup.py

This file was deleted.

62 changes: 23 additions & 39 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,71 +1,55 @@
[tox]
envlist = py{38,39,310,311},lint
isolated_build = true
minversion = 3.2
skip_missing_interpreters = true
tox_pip_extensions_ext_venv_update = true

[testenv]
commands = pytest -v --cache-clear --cov="{toxinidir}" --cov-config="{toxinidir}/pyproject.toml" --cov-report term-missing --basetemp="{envtmpdir}" {posargs} --disable-pytest-warnings
commands_pre = poetry install --no-ansi --with test
commands = poetry run pytest -v --cache-clear --cov="{toxinidir}" --cov-config="{toxinidir}/pyproject.toml" --cov-report term-missing --basetemp="{envtmpdir}" {posargs} --disable-pytest-warnings
deps =
freezegun
pytest
pytest-cov
requests-mock
poetry
poetry-dynamic-versioning
passenv =
BUILD_CACHE
CI
CI_*
CODECOV_*
POETRY_*
TOXENV
TRAVIS
TRAVIS_*
TWINE_*
VCS_*
usedevelop = true
skip_install = true

[testenv:build]
commands_pre =
commands = poetry build

[testenv:codecov]
commands =
codecov
deps =
coverage[toml]
skip_install = true
allowlist_externals =
codecov
commands_pre = poetry install --no-ansi --only coverage
commands = poetry run codecov

[testenv:lint]
commands =
pre-commit run -a {posargs}
deps =
pre-commit
skip_install = true
allowlist_externals = pre-commit
commands_pre =
commands = pre-commit run -a {posargs}

[testenv:mypy]
commands =
mypy --install-types --non-interactive {posargs}
deps =
mypy==v1.3.0
usedevelop = true
commands_pre = poetry install --no-ansi --with mypy
commands = poetry run mypy --install-types --non-interactive {posargs}

[testenv:pylint]
commands =
pylint {posargs}
deps =
pylint==2.17.4
usedevelop = true
commands_pre = poetry install --no-ansi --with pylint
commands = poetry run pylint {posargs}

[testenv:pypi]
commands =
python setup.py sdist bdist_wheel
twine upload --skip-existing dist/*
deps =
setuptools>=43
setuptools_scm[toml]>=3.4
twine
wheel
skip_install = true
commands_pre =
commands = poetry publish --build

[flake8]
# E203, W503, and W504 are all black compat
; E203, W503, and W504 are all black compat
ignore =
E203
W503
Expand Down

0 comments on commit ce9e948

Please sign in to comment.