Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove setuptools #23

Closed
wants to merge 5 commits into from
Closed

Conversation

remyroy
Copy link
Member

@remyroy remyroy commented Apr 25, 2024

Fixes #11 .

This removes setuptools, its dependency, the use of setup.py. It adds a new way to run from the CLI using the standard way to run a module with Python. It updates the related README file sections.

@valefar-on-discord
Copy link
Collaborator

Testing this locally works great but we have an issue, I believe, where the common build_configs requirements.txt utilizes pyinstaller which seems to have a dependency on setuptools which fails due to require-hashes mode:

ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
    setuptools>=42.0.0 from https://files.pythonhosted.org/packages/f7/29/13965af254e3373bceae8fb9a0e6ea0d0e571171b80d6646932131d6439b/setuptools-69.5.1-py3-none-any.whl (from pyinstaller==6.4.0->-r ./build_configs/macos/../common/requirements.txt (line 5))

And it looks like there is still usages of setuptools inDockerfile and Makefile

I haven't looked to deeply at alternatives but do you think this would be a separate piece of work?

@remyroy
Copy link
Member Author

remyroy commented Apr 27, 2024

Let me do more tests with the build process and the Makefile to make sure this is not an issue forward.

@remyroy
Copy link
Member Author

remyroy commented Apr 30, 2024

Which command forces the require-hashes mode? @valefar-on-discord

In this branch, I tried this command in a new venv and that seems to work with all the requirements for the linux build process:

pip install --require-hashes -r build_configs/linux/requirements.txt
Collecting py-ecc==7.0.0
  Using cached py_ecc-7.0.0-py3-none-any.whl (43 kB)
Collecting pycryptodome==3.20.0
  Using cached pycryptodome-3.20.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
Collecting click==7.1.2
  Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting ssz==0.5.0
  Using cached ssz-0.5.0-py3-none-any.whl (44 kB)
Collecting eth-typing==4.1.0
  Using cached eth_typing-4.1.0-py3-none-any.whl (14 kB)
Collecting eth-utils==4.1.0
  Using cached eth_utils-4.1.0-py3-none-any.whl (77 kB)
Collecting mypy-extensions==1.0.0
  Using cached mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)
Collecting lru-dict==1.3.0
  Using cached lru_dict-1.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30 kB)
Collecting pyrsistent==0.16.1
  Using cached pyrsistent-0.16.1.tar.gz (108 kB)
  Preparing metadata (setup.py) ... done
Collecting eth-hash==0.7.0
  Using cached eth_hash-0.7.0-py3-none-any.whl (8.7 kB)
Collecting cytoolz==0.12.3
  Using cached cytoolz-0.12.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB)
Collecting toolz==0.12.1
  Using cached toolz-0.12.1-py3-none-any.whl (56 kB)
Collecting six==1.16.0
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting cached-property==1.5.2
  Using cached cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Collecting pyinstaller==6.4.0
  Using cached pyinstaller-6.4.0-py3-none-manylinux2014_x86_64.whl (670 kB)
Collecting cffi==1.16.0
  Using cached cffi-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (443 kB)
Collecting pycparser==2.21
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting altgraph==0.17.4
  Using cached altgraph-0.17.4-py2.py3-none-any.whl (21 kB)
Collecting macholib==1.16.3
  Using cached macholib-1.16.3-py2.py3-none-any.whl (38 kB)
Collecting pyinstaller-hooks-contrib==2024.1
  Using cached pyinstaller_hooks_contrib-2024.1-py2.py3-none-any.whl (326 kB)
Collecting importlib-metadata==7.0.1
  Using cached importlib_metadata-7.0.1-py3-none-any.whl (23 kB)
Collecting zipp==3.17.0
  Using cached zipp-3.17.0-py3-none-any.whl (7.4 kB)
Collecting typing-extensions==4.9.0
  Using cached typing_extensions-4.9.0-py3-none-any.whl (32 kB)
Collecting packaging==23.2
  Using cached packaging-23.2-py3-none-any.whl (53 kB)
Requirement already satisfied: setuptools>=42.0.0 in /home/remyroy/VirtualEnvs/testedc/lib/python3.10/site-packages (from pyinstaller==6.4.0->-r build_configs/linux/../common/requirements.txt (line 5)) (59.6.0)
Using legacy 'setup.py install' for pyrsistent, since package 'wheel' is not installed.
Installing collected packages: cached-property, altgraph, zipp, typing-extensions, toolz, six, pycryptodome, pycparser, packaging, mypy-extensions, macholib, lru-dict, eth-typing, eth-hash, click, pyrsistent, pyinstaller-hooks-contrib, importlib-metadata, cytoolz, cffi, pyinstaller, eth-utils, ssz, py-ecc
  Running setup.py install for pyrsistent ... done
Successfully installed altgraph-0.17.4 cached-property-1.5.2 cffi-1.16.0 click-7.1.2 cytoolz-0.12.3 eth-hash-0.7.0 eth-typing-4.1.0 eth-utils-4.1.0 importlib-metadata-7.0.1 lru-dict-1.3.0 macholib-1.16.3 mypy-extensions-1.0.0 packaging-23.2 py-ecc-7.0.0 pycparser-2.21 pycryptodome-3.20.0 pyinstaller-6.4.0 pyinstaller-hooks-contrib-2024.1 pyrsistent-0.16.1 six-1.16.0 ssz-0.5.0 toolz-0.12.1 typing-extensions-4.9.0 zipp-3.17.0

@remyroy
Copy link
Member Author

remyroy commented Apr 30, 2024

Oh my bad, I see this line here which I need to explore and investigate a little more:

Requirement already satisfied: setuptools>=42.0.0 in /home/remyroy/VirtualEnvs/testedc/lib/python3.10/site-packages (from pyinstaller==6.4.0->-r build_configs/linux/../common/requirements.txt (line 5)) (59.6.0)

@remyroy
Copy link
Member Author

remyroy commented Apr 30, 2024

Running pipdeptree reveals that pyinstaller and pyinstaller-hooks-contrib depends on setuptools:

$ pipdeptree 
cffi==1.16.0
└── pycparser [required: Any, installed: 2.21]
click==7.1.2
importlib-metadata==7.0.1
└── zipp [required: >=0.5, installed: 3.17.0]
macholib==1.16.3
└── altgraph [required: >=0.17, installed: 0.17.4]
mypy-extensions==1.0.0
pipdeptree==2.19.1
├── packaging [required: >=23.1, installed: 23.2]
└── pip [required: >=23.1.2, installed: 24.0]
py-ecc==7.0.0
├── cached-property [required: >=1.5.1, installed: 1.5.2]
├── eth-typing [required: >=3.0.0, installed: 4.1.0]
└── eth-utils [required: >=2.0.0, installed: 4.1.0]
    ├── cytoolz [required: >=0.10.1, installed: 0.12.3]
    │   └── toolz [required: >=0.8.0, installed: 0.12.1]
    ├── eth-hash [required: >=0.3.1, installed: 0.7.0]
    └── eth-typing [required: >=3.0.0, installed: 4.1.0]
pycryptodome==3.20.0
pyinstaller==6.4.0
├── altgraph [required: Any, installed: 0.17.4]
├── packaging [required: >=22.0, installed: 23.2]
├── pyinstaller-hooks-contrib [required: >=2024.0, installed: 2024.1]
│   ├── packaging [required: >=22.0, installed: 23.2]
│   └── setuptools [required: >=42.0.0, installed: 59.6.0]
└── setuptools [required: >=42.0.0, installed: 59.6.0]
ssz==0.5.0
├── eth-utils [required: >=2, installed: 4.1.0]
│   ├── cytoolz [required: >=0.10.1, installed: 0.12.3]
│   │   └── toolz [required: >=0.8.0, installed: 0.12.1]
│   ├── eth-hash [required: >=0.3.1, installed: 0.7.0]
│   └── eth-typing [required: >=3.0.0, installed: 4.1.0]
├── lru-dict [required: >=1.1.6, installed: 1.3.0]
└── pyrsistent [required: >=0.16.0,<0.17, installed: 0.16.1]
    └── six [required: Any, installed: 1.16.0]
typing_extensions==4.9.0

@remyroy
Copy link
Member Author

remyroy commented Apr 30, 2024

There are probably some overlaps with #26 . I will need to perform tests with both of these concerns in mind.

@remyroy
Copy link
Member Author

remyroy commented Apr 30, 2024

Work continued in #28.

@remyroy remyroy closed this Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the use of setuptools installation
2 participants