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

"rez-pip -i ptvsd" produces bad package #821

Closed
AndreasWetteborn opened this issue Dec 6, 2019 · 6 comments · Fixed by #855
Closed

"rez-pip -i ptvsd" produces bad package #821

AndreasWetteborn opened this issue Dec 6, 2019 · 6 comments · Fixed by #855
Labels
rez-pip ingesting py pkgs into rez (pip, wheels, etc)

Comments

@AndreasWetteborn
Copy link

Running the following command rez-pip --python-version 2.7 -i ptvsd runs successfully but the package created is empty, only the dist-info folder is present, not the actual module. Installing it with pip in an venv works as expected so seems to be rez related.

Package created looks like this:

4.3.2
├── 8155fb0fa65780eccf957cd1a2e822d952f29437
│   └── python
│       └── ptvsd-4.3.2.dist-info
│           ├── INSTALLER
│           ├── LICENSE.txt
│           ├── METADATA
│           ├── RECORD
│           ├── top_level.txt
│           └── WHEEL
└── package.py

Interestingly it works correctly with python3 rez-pip --python-version 3.7 -i ptvsd.

To test run the following. It should work, but is giving an ImportError: No module named ptvsd error.

rez-env ptvsd
python -c "import ptvsd"

Test with rez-version 2.49.0 (and 2.47.2) on CentOS-7.5 and python-2.7

@JeanChristopheMorinPerso JeanChristopheMorinPerso added the rez-pip ingesting py pkgs into rez (pip, wheels, etc) label Dec 8, 2019
@JeanChristopheMorinPerso
Copy link
Member

@AndreasWetteborn by curiosity, do you have the logs from your rez-pip command? I haven't tried yet but it might be useful for anyone who wants to look at this ticket.

@AndreasWetteborn
Copy link
Author

Added logs below.

 $>rez-pip -v  --python-version 2.7 -i ptvsd                                                                                                                                                  
18:08:44 INFO     Using /apps/linux/rez/2.47.2/bin/python -m pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.  
Collecting ptvsd
  Using cached https://files.pythonhosted.org/packages/62/e1/e7153cf86a00955d9751c76473e6fca7f5200c0fd7c0aa0921c72bc6396b/ptvsd-4.3.2-cp27-cp27mu-manylinux1_x86_64.whl                                               
Installing collected packages: ptvsd
Successfully installed ptvsd-4.3.2
WARNING: You are using pip version 19.1.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
18:08:46 DEBUG    Removed 1.0 due to Requires-Python
18:08:46 DEBUG    Removed 1.1 due to Requires-Python
18:08:46 DEBUG    Removed 1.2 due to Description-Content-Type
18:08:46 DEBUG    Removed 2.0 due to Description-Content-Type
18:08:46 DEBUG    Found /tmp/pip-jkoNpS-rez/rez_staging/python/ptvsd-4.3.2.dist-info
18:08:46 DEBUG    Removed 1.0 due to Requires-Python
18:08:46 DEBUG    Removed 1.1 due to Requires-Python
18:08:46 DEBUG    Removed 1.2 due to Description-Content-Type
18:08:46 DEBUG    Removed 2.0 due to Description-Content-Type
18:08:46 DEBUG    Getting requirements from metadata {u'license': u'MIT', u'name': u'ptvsd', u'metadata_version': u'2.1', u'author': u'Microsoft Corporation', u'home_page': u'https://aka.ms/ptvs', u'summary': u'Remote debugging server for Python support in Visual Studio and Visual Studio Code', u'author_email': u'ptvshelp@microsoft.com', u'version': u'4.3.2', u'platform': [u'UNKNOWN'], u'classifiers': [u'Development Status :: 5 - Production/Stable', u'Programming Language :: Python :: 2.7', u'Programming Language :: Python :: 3.4', u'Programming Language :: Python :: 3.5', u'Programming Language :: Python :: 3.6', u'Programming Language :: Python :: 3.7', u'Topic :: Software Development :: Debuggers', u'Operating System :: OS Independent', u'License :: OSI Approved :: Eclipse Public License 2.0 (EPL-2.0)', u'License :: OSI Approved :: MIT License']}
18:08:46 DEBUG    Removed 1.0 due to Requires-Python
18:08:46 DEBUG    Removed 1.1 due to Requires-Python
18:08:46 DEBUG    Removed 1.2 due to Description-Content-Type
18:08:46 DEBUG    Removed 2.0 due to Description-Content-Type
18:08:46 DEBUG    Getting requirements from metadata {u'license': u'MIT', u'name': u'ptvsd', u'metadata_version': u'2.1', u'author': u'Microsoft Corporation', u'home_page': u'https://aka.ms/ptvs', u'summary': u'Remote debugging server for Python support in Visual Studio and Visual Studio Code', u'author_email': u'ptvshelp@microsoft.com', u'version': u'4.3.2', u'platform': [u'UNKNOWN'], u'classifiers': [u'Development Status :: 5 - Production/Stable', u'Programming Language :: Python :: 2.7', u'Programming Language :: Python :: 3.4', u'Programming Language :: Python :: 3.5', u'Programming Language :: Python :: 3.6', u'Programming Language :: Python :: 3.7', u'Topic :: Software Development :: Debuggers', u'Operating System :: OS Independent', u'License :: OSI Approved :: Eclipse Public License 2.0 (EPL-2.0)', u'License :: OSI Approved :: MIT License']}

1 packages were installed:
  ptvsd-4.3.2: /home/andreas/packages/ptvsd/4.3.2/package.py (8155fb0fa65780eccf957cd1a2e822d952f29437)


@SitiSchu
Copy link
Contributor

Seems to work fine with rez 2.50.0.

4.3.2
└───ff5a17a870e473adea6d65972631222d54a381e6
    └───python
        ├───ptvsd
        │   └───_vendored
        │       └───pydevd
        │           ├───pydevd_attach_to_process
        │           │   ├───common
        │           │   ├───linux_and_mac
        │           │   ├───winappdbg
        │           │   │   ├───plugins
        │           │   │   └───win32
        │           │   └───windows
        │           ├───pydevd_concurrency_analyser
        │           ├───pydevd_plugins
        │           │   └───extensions
        │           │       └───types
        │           ├───pydev_ipython
        │           ├───pydev_sitecustomize
        │           ├───_pydevd_bundle
        │           │   └───_debug_adapter
        │           ├───_pydevd_frame_eval
        │           ├───_pydev_bundle
        │           ├───_pydev_imps
        │           └───_pydev_runfiles
        └───ptvsd-4.3.2.dist-info

@j0yu
Copy link
Contributor

j0yu commented Jan 28, 2020

I manage to replicate the failure on a clean CentOS 7 Docker container with rez 2.52.1 here even if I try installing pip first and rez bind pip.

The test checks versions from 2.28 to 2.52, Looks like for installing ptvsd from clean installs, it started failing since version 2.33.0

j0yu added a commit to j0yu/bleeding-rez that referenced this issue Feb 17, 2020
@j0yu
Copy link
Contributor

j0yu commented Feb 17, 2020

@AndreasWetteborn I had a go at it today, turns out ptvsd (at least for v4.3.2) produces these kinds of lines in the *.dist-info/RECORD file after installing:

../../lib/python/ptvsd/compat.py,sha256=U1M_T7BpeiFZ_lsqMoFSFIKWZC8bm2Ve4AFC_7RJbNA,583
../../lib/python/ptvsd/compat.pyc,,
../../lib/python/ptvsd/daemon.py,sha256=2h-B6eCbuQMcYUxeVlLCg5M4MvG6pXMLPZG5TEeH0eo,16966
../../lib/python/ptvsd/daemon.pyc,,
../../lib/python/ptvsd/debugger.py,sha256=HyYTQRfBGBV7g4_3WtcQfM9KiAO3syqOZmnnPIhC-H8,1234
../../lib/python/ptvsd/debugger.pyc,,

This is basically messing up in src/rez/pip.py:pip_install_package() where it thinks the ptvsd Python files do not exist.

Typically for other PyPi packages, their RECORD files don't have those ../lib/python/ prefixes for source files, e.g. for requests:

requests/adapters.py,sha256=WelSM1BCQXdbjEuDsBxqKDADeY8BHmxlrwbNnLN2rr4,21344
requests/adapters.pyc,,
requests/api.py,sha256=fbUo11QoLOoNgWU6FfvNz8vMj9bE_cMmICXBa7TZHJs,6271
requests/api.pyc,,
requests/auth.py,sha256=QB2-cSUj1jrvWZfPXttsZpyAacQgtKLVk14vQW9TpSE,10206
requests/auth.pyc,,
requests/certs.py,sha256=dOB5rV2DZ13dEhq9BUa_4hd5kAqg59e_zUZB00faYz8,453
requests/certs.pyc,,

@nerdvegas
Copy link
Contributor

Juts an FYI, I don't get this. Perhaps it's platform related (I'm on linux Cent7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rez-pip ingesting py pkgs into rez (pip, wheels, etc)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants