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

setup.py still ok? #194

Closed
jafingerhut opened this issue Jun 16, 2023 · 4 comments
Closed

setup.py still ok? #194

jafingerhut opened this issue Jun 16, 2023 · 4 comments

Comments

@jafingerhut
Copy link
Collaborator

Before this commit: ff79b8c

I had a bash script that was installing ptf this way on an Ubuntu 20.04 system:

git clone https://github.com/p4lang/ptf
cd ptf
sudo python3 setup.py install

After that commit, there is an exception thrown when I attempt that setup.py install command.

Should that command still work?

Is it anti-recommended to install ptf that way from source code?

Perhaps I should be using sudo pip install . instead?

@antoninbas
Copy link
Member

@jafingerhut there is a PR open to address this: #193

The issue is caused by this line:

ptf/setup.cfg

Line 25 in bb28a88

install_requires = file: requirements.txt

While the syntax is correct, support for the file: attribute in install_requires was added recently to setuptools. It requires a toolchain more recent than what you'd get by default in Ubuntu 20.04 or even Ubuntu 22.04.

I am waiting for the contributor to address my comment about updating the README before merging the PR.

I would still recommend using pip install . to install ptf, but it will not help in this case, unless you install a recent-enough version of pip (more recent than what you would get by installing python3-pip):

# Install the latest pip version (not python3-pip) as older versions
# seem to have issues when installing from source.
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3 get-pip.py

@jafingerhut
Copy link
Collaborator Author

jafingerhut commented Jun 21, 2023

Lots of more details here: https://docs.google.com/spreadsheets/d/12qip0oKFVK1vPXdC7-VtnRYit-BxKdfsZJPJrDB_usI/edit?usp=sharing

As of the 2023-Jun-19 version of this ptf repo, sudo pip install . installs successfully on several versions of Ubuntu and Fedora, but strangely it fails on Ubuntu 22.04 (but succeeds on Ubuntu 20.04 and 23.04). Ubuntu 22.04 seems to be the odd one out for some reason.

@antoninbas
Copy link
Member

@jafingerhut your doc is not public

We are still waiting on #197 in order to fix this issue

@jafingerhut
Copy link
Collaborator Author

Sorry about that. Should be public to anyone with the link now, and I've updated the link in the comment above in case it changed as a result.

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

No branches or pull requests

2 participants