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

Problems with underscores #47

Closed
reaperhulk opened this issue May 5, 2014 · 12 comments · Fixed by #70
Closed

Problems with underscores #47

reaperhulk opened this issue May 5, 2014 · 12 comments · Fixed by #70
Assignees
Labels
Milestone

Comments

@reaperhulk
Copy link
Contributor

Package names with underscores cause twine trouble. I'm not sure if this is a twine issue or a pypi API issue or what, but it's related to pkg_resources.safe_name.

@sigmavirus24
Copy link
Member

Is this still an issue? If so, can you provide some greater detail?

@reaperhulk
Copy link
Contributor Author

Yes this is still an issue, although last time I tried it only failed on the sdist and succeeded on the wheel I believe. To replicate use twine to upload a package with an underscore in the name (this bug was originally filed for cryptography_vectors.

@sigmavirus24 sigmavirus24 self-assigned this Dec 2, 2014
@sigmavirus24
Copy link
Member

I wasn't able to reproduce this with testpypi and the requests-toolbelt sdist (and I tried with a wheel too): https://testpypi.python.org/pypi/requests-toolbelt/0.3.1 Maybe @dstufft can clarify?

@dstufft
Copy link
Member

dstufft commented Dec 2, 2014

I think you need something named foo_bar not foo-bar to reproduce.

On Dec 2, 2014, at 3:51 PM, Ian Cordasco notifications@github.com wrote:

I wasn't able to reproduce this with testpypi and the requests-toolbelt sdist (and I tried with a wheel too): https://testpypi.python.org/pypi/requests-toolbelt/0.3.1 Maybe @dstufft can clarify?


Reply to this email directly or view it on GitHub.

@sigmavirus24
Copy link
Member

The file I uploaded was requests_toolbelt-0.3.1.tar.gz to a project that was
created as requests_toolbelt on testpypi. Am I missing something?

On Tue, Dec 02, 2014 at 01:19:52PM -0800, Donald Stufft wrote:

I think you need something named foo_bar not foo-bar to reproduce.

On Dec 2, 2014, at 3:51 PM, Ian Cordasco notifications@github.com wrote:

I wasn't able to reproduce this with testpypi and the requests-toolbelt sdist (and I tried with a wheel too): https://testpypi.python.org/pypi/requests-toolbelt/0.3.1 Maybe @dstufft can clarify?

???
Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#47 (comment)

@dstufft
Copy link
Member

dstufft commented Dec 2, 2014

Hmm. Did you try uploading the wheel of requests_toplbelt ?

On Dec 2, 2014, at 4:22 PM, Ian Cordasco notifications@github.com wrote:

The file I uploaded was requests_toolbelt-0.3.1.tar.gz to a project that was
created as requests_toolbelt on testpypi. Am I missing something?

On Tue, Dec 02, 2014 at 01:19:52PM -0800, Donald Stufft wrote:

I think you need something named foo_bar not foo-bar to reproduce.

On Dec 2, 2014, at 3:51 PM, Ian Cordasco notifications@github.com wrote:

I wasn't able to reproduce this with testpypi and the requests-toolbelt sdist (and I tried with a wheel too): https://testpypi.python.org/pypi/requests-toolbelt/0.3.1 Maybe @dstufft can clarify?

???
Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#47 (comment)

Reply to this email directly or view it on GitHub.

@sigmavirus24
Copy link
Member

Yep. Both were successful.

On Tue, Dec 02, 2014 at 01:24:46PM -0800, Donald Stufft wrote:

Hmm. Did you try uploading the wheel of requests_toplbelt ?

On Dec 2, 2014, at 4:22 PM, Ian Cordasco notifications@github.com wrote:

The file I uploaded was requests_toolbelt-0.3.1.tar.gz to a project that was
created as requests_toolbelt on testpypi. Am I missing something?

On Tue, Dec 02, 2014 at 01:19:52PM -0800, Donald Stufft wrote:

I think you need something named foo_bar not foo-bar to reproduce.

On Dec 2, 2014, at 3:51 PM, Ian Cordasco notifications@github.com wrote:

I wasn't able to reproduce this with testpypi and the requests-toolbelt sdist (and I tried with a wheel too): https://testpypi.python.org/pypi/requests-toolbelt/0.3.1 Maybe @dstufft can clarify?

???
Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#47 (comment)
???
Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#47 (comment)

@reaperhulk
Copy link
Contributor Author

The title itself should have an underscore in it setup.py

On Dec 2, 2014, at 11:40 AM, Ian Cordasco notifications@github.com wrote:

Yep. Both were successful.

On Tue, Dec 02, 2014 at 01:24:46PM -0800, Donald Stufft wrote:

Hmm. Did you try uploading the wheel of requests_toplbelt ?

On Dec 2, 2014, at 4:22 PM, Ian Cordasco notifications@github.com wrote:

The file I uploaded was requests_toolbelt-0.3.1.tar.gz to a project that was
created as requests_toolbelt on testpypi. Am I missing something?

On Tue, Dec 02, 2014 at 01:19:52PM -0800, Donald Stufft wrote:

I think you need something named foo_bar not foo-bar to reproduce.

On Dec 2, 2014, at 3:51 PM, Ian Cordasco notifications@github.com wrote:

I wasn't able to reproduce this with testpypi and the requests-toolbelt sdist (and I tried with a wheel too): https://testpypi.python.org/pypi/requests-toolbelt/0.3.1 Maybe @dstufft can clarify?

???
Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#47 (comment)
???
Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#47 (comment)

Reply to this email directly or view it on GitHub.

@sigmavirus24
Copy link
Member

I don't remember if the name has a _ in the setup.py. I'll have to check that tonight.

@sigmavirus24 sigmavirus24 added this to the 1.4 milestone Dec 8, 2014
@sigmavirus24
Copy link
Member

So if I apply this patch to the source of requests-toolbelt:

diff --git a/requests_toolbelt/__init__.py b/requests_toolbelt/__init__.py
index ce5e994..2721ff9 100644
--- a/requests_toolbelt/__init__.py
+++ b/requests_toolbelt/__init__.py
@@ -13,7 +13,7 @@ __title__ = 'requests-toolbelt'
 __authors__ = 'Ian Cordasco, Cory Benfield'
 __license__ = 'Apache v2.0'
 __copyright__ = 'Copyright 2014 Ian Cordasco, Cory Benfield'
-__version__ = '0.3.1'
+__version__ = '0.3.1post1'
 __version_info__ = tuple(int(i) for i in __version__.split('.'))

 from .adapters import SSLAdapter, SourceAddressAdapter
diff --git a/setup.py b/setup.py
index 6f903f9..fbf83ea 100644
--- a/setup.py
+++ b/setup.py
@@ -38,7 +38,7 @@ packages = [
 ]

 setup(
-    name="requests-toolbelt",
+    name="requests_toolbelt",
     version=__version__,
     description="A utility belt for advanced users of python-requests",
     long_description="\n\n".join([open("README.rst").read(),

Then I get:

$ twine upload -r test dist/requests_toolbelt-0.3.1post1.tar.gz
Uploading distributions to https://testpypi.python.org/pypi
Uploading requests_toolbelt-0.3.1post1.tar.gz
HTTPError: 403 Client Error: You are not allowed to edit 'requests_toolbelt' package information

PyPI considers requests-toolbelt and requests_toolbelt to be the same (I had tried creating a package named requests_toolbelt and it created requests-toolbelt anyway), so this is definitely still a problem. I'll have to play with pkg_resources.safe_name as was suggested originally to see if that fixes this.

@reaperhulk
Copy link
Contributor Author

Awesome, thanks @sigmavirus24! Next time we do a cryptography release I'll pull from master and test during the release process if this isn't in a release yet.

@sigmavirus24
Copy link
Member

I'm hoping to get 1.4 out soon. I have a due date set for it and there isn't much left to do for it, so I might ship it ahead of time.

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.

3 participants