-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from setuptools to hatch (#1085)
* Migrate from setuptools to hatch - Fixes issues with editable builds, [broken by new versions of setuptools](pypa/setuptools#3548) - Migrates project to `pyproject.toml`, [as recommended](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/) * Move some configuration from setup.cfg to pyproject.toml * Don't install setuptools on CI - Not required anymore * Move configuration to pyproject.toml * Move more configuration to pyproject.toml * Rename some minor fields * Use Python 3.12 to publish the package --------- Co-authored-by: Uxio Fuentefria <6909403+Uxio0@users.noreply.github.com>
- Loading branch information
Showing
8 changed files
with
139 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VERSION = "6.0.0b30" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "safe-eth-py" | ||
dynamic = ["version"] | ||
description = "Safe Ecosystem Foundation utilities for Ethereum projects" | ||
readme = "README.rst" | ||
license = "MIT" | ||
requires-python = ">=3.9" | ||
authors = [ | ||
{ name = "Uxío", email = "uxio@safe.global" }, | ||
] | ||
keywords = [ | ||
"cowswap", | ||
"django", | ||
"ethereum", | ||
"gnosis", | ||
"safe", | ||
"web3", | ||
] | ||
classifiers = [ | ||
"Environment :: Web Environment", | ||
"Framework :: Django", | ||
"Framework :: Django :: 2.0", | ||
"Framework :: Django :: 3.0", | ||
"Framework :: Django :: 4.0", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Topic :: Internet :: WWW/HTTP", | ||
"Topic :: Internet :: WWW/HTTP :: Dynamic Content", | ||
] | ||
dependencies = [ | ||
"packaging", | ||
"py-evm>=0.7.0a1", | ||
"requests>=2", | ||
"safe-pysha3>=1.0.0", | ||
"web3>=6.2.0", | ||
] | ||
|
||
[project.optional-dependencies] | ||
django = [ | ||
"django-filter>=2", | ||
"django>=2", | ||
"djangorestframework>=2", | ||
] | ||
|
||
[project.urls] | ||
Documentation = "https://safe-eth-py.readthedocs.io/en/latest/" | ||
Homepage = "https://github.com/safe-global/safe-eth-py" | ||
Source = "https://github.com/safe-global/safe-eth-py" | ||
Tracker = "https://github.com/safe-global/safe-eth-py/issues" | ||
|
||
[tool.hatch.version] | ||
path = "gnosis/__init__.py" | ||
|
||
[tool.hatch.envs.types] | ||
extra-dependencies = [ | ||
"mypy>=1.0.0", | ||
] | ||
|
||
[tool.hatch.envs.types.scripts] | ||
check = "mypy --install-types --non-interactive {args:gnosis}" | ||
|
||
[tool.coverage.run] | ||
include = ["gnosis/*"] | ||
# source_pkgs = ["gnosis", "tests"] | ||
branch = true | ||
parallel = true | ||
omit = [ | ||
"*__init__.py*", | ||
"*tests*", | ||
"*/migrations/*", | ||
] | ||
|
||
#[tool.coverage.paths] | ||
#prueba = ["src/gnosis", "*/gnosis/src/gnosis"] | ||
#tests = ["tests", "*/gnosis/tests"] | ||
|
||
[tool.coverage.report] | ||
exclude_lines = [ | ||
"no cov", | ||
"if __name__ == .__main__.:", | ||
"if TYPE_CHECKING:", | ||
"if settings.DEBUG", | ||
"raise NotImplementedError", | ||
"pass", | ||
] | ||
|
||
[tool.hatch.build.targets.sdist] | ||
include = [ | ||
"/gnosis", | ||
] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = [ | ||
"/gnosis", | ||
] | ||
|
||
[tool.isort] | ||
profile = "black" | ||
default_section = "THIRDPARTY" | ||
known_first_party = "gnosis" | ||
known_safe_foundation = "py_eth_sig_utils" | ||
known_django = "django" | ||
sections = [ | ||
"FUTURE", | ||
"STDLIB", | ||
"DJANGO", | ||
"THIRDPARTY", | ||
"SAFE_FOUNDATION", | ||
"FIRSTPARTY", | ||
"LOCALFOLDER", | ||
] | ||
|
||
[tool.mypy] | ||
python_version = "3.12" | ||
check_untyped_defs = true | ||
ignore_missing_imports = true | ||
warn_unused_ignores = true | ||
warn_redundant_casts = true | ||
warn_unused_configs = true | ||
|
||
[tool.pytest_env] | ||
DJANGO_SETTINGS_MODULE = "config.settings.test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
-r requirements-test.txt | ||
flake8 | ||
gitpython | ||
hatch | ||
ipdb | ||
ipython | ||
isort | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters