From ac4b5bcfdac4a8e70d3545fab3ed623659d3a295 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Thu, 15 Feb 2024 15:30:28 +0100 Subject: [PATCH 1/2] Modernize install (PEP 621) --- pyproject.toml | 38 ++++++++++++++++++++++++++++++++++++++ setup.py | 35 ++--------------------------------- 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dbd49cc..fa6b6bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,41 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "test_generator" +version = "0.0.1" +authors = [{ name = "Trail of Bits" }] +description = "A tool for automatically generating unit tests from Echidna and Medusa reproducers." +readme = "README.md" +license = { "text" = "AGPL-3.0" } +urls = { "Homepage" = "https://github.com/crytic/test-generator" } +requires-python = ">=3.10" +dependencies = [ + "colorama>=0.4.0", + "slither_analyzer>=0.10.0", + "jinja2>=3.1.0" +] + +[project.optional-dependencies] +lint = [ + "pylint==2.13.4", + "black==22.3.0" +] +test = [ + "pytest", + "solc-select>=0.1.4" +] +dev = [ + "test_generator[lint,test]" +] + +[project.scripts] +test-generator = "test_generator.main:main" + +[tool.setuptools.packages.find] + where = ["."] + [tool.black] target-version = ["py310"] line-length = 100 diff --git a/setup.py b/setup.py index f1e2020..a4f49f9 100644 --- a/setup.py +++ b/setup.py @@ -1,33 +1,2 @@ -""" -Install script for crytic-exploit package -""" -from setuptools import setup, find_packages - -setup( - name="test_generator", - description="A tool for automatically generating unit tests from Echidna and Medusa reproducers", - url="https://github.com/crytic/test-generator", - author="Trail of Bits", - version="0.0.1", - packages=find_packages(exclude=["tests"]), - python_requires=">=3.10", - install_requires=[ - "colorama>=0.4.0", - "slither_analyzer>=0.10.0", - "jinja2>=3.1.0", - ], - extras_require={ - "lint": [ - "black==22.3.0", - "pylint==2.13.4", - ], - "test": [ - "pytest", - "solc-select>=0.1.4", - ], - "dev": [ - "test_generator[lint,test]", - ], - }, - entry_points={"console_scripts": ["test-generator = test_generator.main:main"]}, -) +import setuptools +setuptools.setup() From 1246d6574ec54e8cd29c8fc320f494169e83afad Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Thu, 15 Feb 2024 15:35:27 +0100 Subject: [PATCH 2/2] linter on setup.py --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index a4f49f9..354d3b9 100644 --- a/setup.py +++ b/setup.py @@ -1,2 +1,6 @@ +""" +Install script for test-generator package +""" import setuptools + setuptools.setup()