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

Incorrect package name detection with OSX version scheme #88

Closed
arcivanov opened this issue Aug 4, 2015 · 6 comments · Fixed by #89
Closed

Incorrect package name detection with OSX version scheme #88

arcivanov opened this issue Aug 4, 2015 · 6 comments · Fixed by #89
Labels
Milestone

Comments

@arcivanov
Copy link
Contributor

For package-name-0.0.1.dev0.linux-x86_64.tar.gz the name is correctly detected as package-name
For package-name-0.0.1.dev0.macosx-10.10-intel.tar.gz the name is incorrectly detected as package-name-0.0.1.dev0.macosx

@arcivanov arcivanov changed the title Incorrect package name detection with OSX version scheme. Incorrect package name detection with OSX version scheme Aug 4, 2015
@ankostis
Copy link
Member

ankostis commented Aug 4, 2015

Can you give a concrete example with some published package in pypi?

@arcivanov
Copy link
Contributor Author

Published pypi package - dunno. But that is the name that is generated by ./setup.py bdist_dumb on Mac OSX Yosemite.

@arcivanov
Copy link
Contributor Author

running bdist_dumb
running build
running build_py
creating build
creating build/lib
creating build/lib/package_name
copying package_name/__init__.py -> build/lib/package_name
installing to build/bdist.macosx-10.10-intel/dumb
running install
running install_lib
creating build/bdist.macosx-10.10-intel
creating build/bdist.macosx-10.10-intel/dumb
creating build/bdist.macosx-10.10-intel/dumb/Users
creating build/bdist.macosx-10.10-intel/dumb/Users/arcivanov
creating build/bdist.macosx-10.10-intel/dumb/Users/arcivanov/pyhome
creating build/bdist.macosx-10.10-intel/dumb/Users/arcivanov/pyhome/current
creating build/bdist.macosx-10.10-intel/dumb/Users/arcivanov/pyhome/current/lib
creating build/bdist.macosx-10.10-intel/dumb/Users/arcivanov/pyhome/current/lib/python2.7
creating build/bdist.macosx-10.10-intel/dumb/Users/arcivanov/pyhome/current/lib/python2.7/site-packages
creating build/bdist.macosx-10.10-intel/dumb/Users/arcivanov/pyhome/current/lib/python2.7/site-packages/package_name
copying build/lib/package_name/__init__.py -> build/bdist.macosx-10.10-intel/dumb/Users/arcivanov/pyhome/current/lib/python2.7/site-packages/package_name
byte-compiling build/bdist.macosx-10.10-intel/dumb/Users/arcivanov/pyhome/current/lib/python2.7/site-packages/package_name/__init__.py to __init__.pyc
running install_egg_info
running egg_info
writing pbr to package_name.egg-info/pbr.json
writing package_name.egg-info/PKG-INFO
writing top-level names to package_name.egg-info/top_level.txt
writing dependency_links to package_name.egg-info/dependency_links.txt
writing entry points to package_name.egg-info/entry_points.txt
reading manifest file 'package_name.egg-info/SOURCES.txt'
writing manifest file 'package_name.egg-info/SOURCES.txt'
Copying package_name.egg-info to build/bdist.macosx-10.10-intel/dumb/Users/arcivanov/pyhome/current/lib/python2.7/site-packages/package_name-0.0.1.dev0-py2.7.egg-info
running install_scripts
Creating tar archive
removing 'build/bdist.macosx-10.10-intel/dumb' (and everything under it)

@ankostis
Copy link
Member

ankostis commented Aug 4, 2015

I do not have a MacOS.
Nevertheless I cannot find anything irregular in the setup.py of pypiserver.

Could it be a setuptools/distutils issue undex MacOS?
In any case i suggest to list here the python-version and which distribution package & version your environment has installed, for reference.

@arcivanov
Copy link
Contributor Author

Oh, I think there is a miscommunication. This is the problem within pypi-server where the uploaded hosted packages are not correctly identified by package-name and version. The problem I'm trying to fix right now is here: https://github.com/pypiserver/pypiserver/blob/master/pypiserver/core.py#L100

Actually I found that in both cases there is a problem, but in case of OSX the package name is not identified correctly at all:

====================================================================================================================================== FAILURES ======================================================================================================================================
________________________________________________________________________________________ test_guess_pkgname_and_version[package-name-0.0.1.dev0.linux-x86_64.tar.gz-package-name-0.0.1.dev0] _________________________________________________________________________________________

filename = 'package-name-0.0.1.dev0.linux-x86_64.tar.gz', pkgname = 'package-name', version = '0.0.1.dev0'

    @pytest.mark.parametrize(("filename", "pkgname", "version"), files)
    def test_guess_pkgname_and_version(filename, pkgname, version):
>       assert core.guess_pkgname_and_version(filename) == (pkgname, version)
E       assert ('package-nam...linux-x86_64') == ('package-name', '0.0.1.dev0')
E         At index 1 diff: '0.0.1.dev0.linux-x86_64' != '0.0.1.dev0'
E         Use -v to get the full diff

tests/test_core.py:50: AssertionError
-------------------------------------------------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------------------------------------------------
['package-name', '0.0.1.dev0.linux-x86_64']
_____________________________________________________________________________________ test_guess_pkgname_and_version[package-name-0.0.1.dev0.macosx-10.10-intel.tar.gz-package-name-0.0.1.dev0] ______________________________________________________________________________________

filename = 'package-name-0.0.1.dev0.macosx-10.10-intel.tar.gz', pkgname = 'package-name', version = '0.0.1.dev0'

    @pytest.mark.parametrize(("filename", "pkgname", "version"), files)
    def test_guess_pkgname_and_version(filename, pkgname, version):
>       assert core.guess_pkgname_and_version(filename) == (pkgname, version)
E       assert ('package-nam...'10.10-intel') == ('package-name', '0.0.1.dev0')
E         At index 0 diff: 'package-name-0.0.1.dev0.macosx' != 'package-name'
E         Use -v to get the full diff

tests/test_core.py:50: AssertionError
-------------------------------------------------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------------------------------------------------
['package-name', '0.0.1.dev0.macosx', '10.10-intel']
======================================================================================================================== 2 failed, 87 passed in 0.71 seconds =========================================================================================================================

As you can see the package name in case of Linux is correct but version is wrong as it carries the platform identifiers. In case of an OSX package even the package name is incorrect.

arcivanov added a commit to arcivanov/pypiserver that referenced this issue Aug 5, 2015
Fixes package name and package version handling of bdist_dumb
packages

Detects OS name boundary as specified in
http://svn.python.org/projects/python/trunk/Lib/distutils/util.py

Also detects cpN and pyN boundary

fixes pypiserver#88, connected to pypiserver#88
@arcivanov
Copy link
Contributor Author

@ankostis bump

@ankostis ankostis added this to the M1.1.8 milestone Sep 11, 2015
ankostis added a commit that referenced this issue Sep 11, 2015
Incorrect package name detection with OSX version scheme #88
ankostis added a commit to ankostis/pypiserver that referenced this issue Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants