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

pex cannot resolve local dependencies with dash in the name #383

Closed
npwolf opened this issue May 1, 2017 · 2 comments
Closed

pex cannot resolve local dependencies with dash in the name #383

npwolf opened this issue May 1, 2017 · 2 comments
Labels

Comments

@npwolf
Copy link

npwolf commented May 1, 2017

pex does not work well with a local pypi. So I followed the work around described here #270 . However, if you have dependencies with a dash in the name like javaobj-py3 or asn1-modules, pex fails. The following demonstrates the issue.

Note in the following example, pip is configured to use a local pypi like so:

[root@8d56519da316 /]# cat /root/.pip/pip.conf
[global]
index-url = https://my-local-pypi/pypi/simple

First download the wheel:

pip wheels -w wheels javaobj-py3==0.2.3
ERROR: unknown command "wheels" - maybe you meant "wheel"
[root@4d3e53cc5bc5 newdir]# pip wheel -w wheels javaobj-py3==0.2.3
Collecting javaobj-py3==0.2.3
  Downloading https://my-local-pypi/pypi/simple/javaobj-py3/javaobj-py3-0.2.3-py2.py3-none-any.whl
  Saved ./wheels/javaobj-py3-0.2.3-py2.py3-none-any.whl
Skipping javaobj-py3, due to already being wheel.

Now try creating a pex file with it.

pex --no-index --repo=wheels -o this_wont_work.pex javaobj-py3==0.2.3
Could not satisfy all requirements for javaobj-py3==0.2.3:
    javaobj-py3==0.2.3

Here is a workaround which will create a hard link to all python modules and replace the a dash with underscore.

ln wheels/javaobj-py3-0.2.3-py2.py3-none-any.whl wheels/javaobj_py3-0.2.3-py2.py3-none-any.whl
pex --no-index --repo=wheels -o this_workaround_works.pex javaobj-py3==0.2.3
[root@4d3e53cc5bc5 newdir]# pex --no-index --repo=wheels -o this_workaround_works.pex javaobj-py3==0.2.3
[root@4d3e53cc5bc5 newdir]# ls -la
total 464
drwxr-xr-x. 1 root root     62 May  1 23:42 .
drwxrwxrwt. 1 root root     26 May  1 23:42 ..
-rwxr-xr-x. 1 root root 471703 May  1 23:42 this_workaround_works.pex
drwxr-xr-x. 1 root root    152 May  1 23:26 wheels
@kwlzn
Copy link
Contributor

kwlzn commented Jul 10, 2017

seems to me like the filename of the wheel as stored in your local pypi server is malformed, so it would make sense that pex would fail to resolve. the use of - in the package name in a filename is disallowed by the wheel spec. how are you generating it?

noting that the filename on pypi is: javaobj_py3-0.2.3-py2.py3-none-any.whl, which is correct and would 'just work' in this case.

@kwlzn kwlzn added the wontfix label Jul 10, 2017
@kwlzn
Copy link
Contributor

kwlzn commented Jul 10, 2017

going to tentatively mark this one as 'WONTFIX' - despite pip's accommodation of broken wheel filenames, we likely won't want to bother supporting this in pex since the correct path to proper wheel naming is straightforward and nets the added benefit of future proofing.

could be persuaded otherwise if there was a concrete case for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants