From d71e8b33eac0642b386ba91ff2b44aeff6be0651 Mon Sep 17 00:00:00 2001 From: Uxio Fuentefria Date: Thu, 22 Sep 2022 12:25:43 +0200 Subject: [PATCH] Migrate setup.py to setup.cfg - Remove pyproject.toml, it was breaking local install (`pip -e ...`) - Set version 4.5.0 --- .github/workflows/python.yml | 2 +- LICENSE | 2 +- pyproject.toml | 3 -- setup.cfg | 65 ++++++++++++++++++++++++++++++++++++ setup.py | 58 ++------------------------------ 5 files changed, 70 insertions(+), 60 deletions(-) delete mode 100644 pyproject.toml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index a731188cf..f537700f1 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -58,7 +58,7 @@ jobs: SOURCE_FOLDER: gnosis DJANGO_SETTINGS_MODULE: config.settings.test ETHEREUM_MAINNET_NODE: ${{ secrets.ETHEREUM_MAINNET_NODE }} - - name: Test setup.py + - name: Test packaging run: pip install -e . - name: Send results to coveralls run: coveralls --service=github diff --git a/LICENSE b/LICENSE index 236b5cd17..86aa6415b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Gnosis Ltd +Copyright (c) 2018 Safe Ecosystem Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index b0f076532..000000000 --- a/pyproject.toml +++ /dev/null @@ -1,3 +0,0 @@ -[build-system] -requires = ["setuptools>=42"] -build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index 7e26df1dc..dc5016fbd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,68 @@ +[metadata] +name = safe-eth-py +version = 4.5.0 +description = Safe Ecosystem Foundation utilities for Ethereum projects +long_description = file: README.rst +long_description_content_type = text/x-rst; charset=UTF-8 +keywords = + ethereum + web3 + django + safe + cowswap + gnosis +url = https://github.com/safe-global/safe-eth-py +author = Uxío +author_email = uxio@safe.global +license = MIT License +license_files = + LICENSE +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.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Topic :: Internet :: WWW/HTTP + Topic :: Internet :: WWW/HTTP :: Dynamic Content +project_urls = + Documentation = https://safe-eth-py.readthedocs.io/en/latest/ + Source = https://github.com/safe-global/safe-eth-py + Tracker = https://github.com/safe-global/safe-eth-py/issues + +[options] +packages = find: +platforms = any +include_package_data = True +install_requires = + cached-property>=1.5; python_version < "3.8" + eip712_structs + packaging + py-evm==0.5.0a3 + pysha3>=1.0.0 + requests>=2 + typing-extensions>=3.10; python_version < "3.8" + web3>=5.23.0 +python_requires = >=3.7 + +[options.package_data] +gnosis = + py.typed + *.json + +[options.extras_require] +django = + django>=2 + django-filter>=2 + djangorestframework>=2 + [flake8] max-line-length = 88 select = C,E,F,W,B,B950 diff --git a/setup.py b/setup.py index 0bfa91364..1abbd068c 100644 --- a/setup.py +++ b/setup.py @@ -1,56 +1,4 @@ -import os +import setuptools -from setuptools import find_packages, setup - -with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme: - README = readme.read() - -# allow setup.py to be run from any path -os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) - -requirements = [ - "cached-property>=1.5; python_version < '3.8'", - "eip712_structs", - "packaging", - "py-evm==0.5.0a3", - "pysha3>=1.0.0", - "requests>=2", - "typing-extensions>=3.10; python_version < '3.8'", - "web3>=5.23.0", -] - -extras_require = {"django": ["django>=2", "django-filter>=2", "djangorestframework>=2"]} - -setup( - name="safe-eth-py", - version="4.4.0", - packages=find_packages(), - package_data={"gnosis": ["py.typed"]}, - install_requires=requirements, - include_package_data=True, - extras_require=extras_require, - python_requires=">=3.7", - license="MIT License", - description="Gnosis libraries for Python Projects", - long_description=README, - url="https://github.com/safe-global/safe-eth-py", - author="Uxío", - author_email="uxio@safe.global", - keywords=["ethereum", "web3", "django", "rest", "gnosis"], - 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.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet :: WWW/HTTP :: Dynamic Content", - ], -) +if __name__ == "__main__": + setuptools.setup()