p4lang / ptf

Packet Test Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setup.py still ok?

jafingerhut opened this issue · comments

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?

@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

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.

@jafingerhut your doc is not public

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

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.