-
Notifications
You must be signed in to change notification settings - Fork 51
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
Pins dependency version and fix mininet install with pip #41
Conversation
Special care needs to be taken with pinned deps (i.e., '==') so that ipmininet does not prevent those packages from being upgraded in the future...
I'd personally for for /opt for that, and then either symlinking the exec in /usr/bin or modifying $PATH (possibly using /etc/environment or ...)
I am certain I used a similar syntax without issues a few years ago (possibly with the now deprecated hook). An alternative would be to auto-detect whether mininet is installed in your install script and do it 'manually' (i.e., side-stepping pip as we're not using pypi for that dep. anyway). |
43115a5
to
c566996
Compare
I only set mininet with a strict version.
Ok
Yes, with the deprecated argument, you could set a dependency_links parameter with github links from pip 10. And actually, the git link directly in the install_require parameter works since pip 18.1. I would rather not use the manual strategy. This might prevent someone from using specific parameters of pip (e.g., "--target <dir>") and it is also a bit strange not to have mininet as explicit python dependence. |
I only set mininet with a strict version.
I chose 2.3.0d6 because 2.2.2 (the last stable version) does not support
Python3.
Sounds reasonable, I was mostly pointing to dependencies such as futures/...
Yes, with the deprecated argument, you could set a dependency_links
parameter with github links from pip 10. And actually, the git link directly in
the install_require parameter works since pip 18.1.
I would rather not use the manual strategy. This might prevent someone from
using specific parameters of pip (e.g., "--target <dir>") and it is also a bit
strange not to have mininet as explicit python dependence.
Good point. I can you add version check in the setup script to warn that it will fail
to install mininet and maybe print a manual fallback to be executed by the user?
Beside updating pip itsel ofc (which might be managed by the distribution hence
lag behind a few versions). Such issue is temporary anyway and we may just ignore
it altogether past documentation.
…
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#41?email_source=notifications&em
ail_token=AAJVCUKIRLZ5XTY4CX7ZDALQCBRBRA5CNFSM4IHDS5U2YY3PNVW
WK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3
EPATA#issuecomment-516485196> , or mute the thread
<https://github.com/notifications/unsubscribe-
auth/AAJVCUKV5WJX4ENWRI2EYATQCBRBRANCNFSM4IHDS5UQ> .
<https://github.com/notifications/beacon/AAJVCUNMO4N67QDCN5JF3SDQCB
RBRA5CNFSM4IHDS5U2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMV
XHJKTDN5WW2ZLOORPWSZGOD3EPATA.gif>
|
6a7beae
to
46a1bd6
Compare
Ok, I modified the setup.py file to take into account the pip version. Nevertheless, this improves the PR since it is does no longer require to update pip. # Get back Pip version
try:
version = parse_version(require("pip")[0].version)
except IndexError:
version = parse_version("0")
print("We cannot find the version of pip."
"We assume that is it inferior to 18.1.")
if version >= parse_version("18.1"):
install_requires.append('mininet @ git+https://github.com/mininet/mininet@{ver}'
.format(ver=MININET_VERSION))
else:
print("You should run pip with --process-dependency-links to install all dependencies")
install_requires.append('mininet=={ver}'.format(ver=MININET_VERSION))
dependency_links.append('git+https://github.com/mininet/mininet@{ver}#egg=mininet-{ver}'
.format(ver=MININET_VERSION)) |
This implies changes in the install scripts: they are moved inside the ipmininet library so that they can be used by the `setup.py` file. The documentation is also updated.
46a1bd6
to
d735a6b
Compare
Closes Issue #39
This pins versions of dependencies in the
setup.py
.It also installs the Mininet dependencies if not already present.
This implies changes in the install scripts: they are moved inside the ipmininet library so that they can be used by the
setup.py
file. The documentation is also updated.Some points to discuss:
mininet @ git+https://github.com/mininet/mininet@2.3.0d6
is only supported from pip 19. There is another way of installing a dependency from github but it is deprecated and it requires extra arguments when running pip. Still, this might not be the best solution.