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

Python CDK does not work with Pipenv without changing the package name #3671

Closed
1 task done
olivier-schmitt opened this issue Aug 15, 2019 · 6 comments
Closed
1 task done
Assignees
Labels
guidance Question that needs advice or information. language/python Related to Python bindings management/devenv Related to CDK development/build environment

Comments

@olivier-schmitt
Copy link

olivier-schmitt commented Aug 15, 2019

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.

  • I'm submitting a ...

    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior?
    Python 3.6, Pipenv 2018.11.26, CDK last version module Route 53

There seems to be an issue with the '.' in the package name.

Pipenv tries to find aws-cdk package and not aws-cdk.aws-route53

BTW, it works with pip which supports the '.'

Here is a Pipfile :

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
aws-cdk.aws-route53 = "*"

[requires]
python_version = "3.6"

This one does not work but if I change the '.' in '-' it works (aws-cdk-aws-route53) .

  • What is the expected behavior (or behavior of feature suggested)?
    "pipenv install" working, downloading the dependency.

  • What is the motivation / use case for changing the behavior or adding this feature?
    Just playing with the Python CDK like I do with boto3

  • Please tell us about your environment:

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

It seems that this problem is already known:
pypa/pipenv#3013

@olivier-schmitt olivier-schmitt added the needs-triage This issue or PR still needs to be triaged. label Aug 15, 2019
@garnaat
Copy link
Contributor

garnaat commented Aug 19, 2019

Have you tried this with the latest version of pip? It looks like a fix was included in the 19.x releases.

I'm not sure that there is anything we can do on our side to address this.

@olivier-schmitt
Copy link
Author

Yes, I've tried, it seems the issue is more on the Pipenv side which has not been updated since the version '2018.11.26'.
So no issue with pip (it works perfectly) but with pipenv.
I will create an issue on the pipenv side and reference this one, and we'll see.
Thanks.

@jthornbrue
Copy link

This is really annoying me, too. A workaround would be to refactor cdk so it doesn't have dots in the package names. But, it seems like pipenv should handle it, since pip itself handles it. @olivier-schmitt, do you have a link to the pipenv issue? I'd like to follow.

@mikelane
Copy link

mikelane commented Sep 27, 2019

You can install packages with dots just fine. You just need to put the name of the package in quotes. Example:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pytest = "*"

[packages]
hello = {editable = true,file = "file:///Users/***/learns/aws/cdk/hello-cdk"}
"aws-cdk.aws-route53" = "~=1.9"

[requires]
python_version = "3.7"

proof that it works:

{
	"_meta": {
		"hash": {
			"sha256": "8d4d4df7e2f85a619708d03544ff9e1a71a44cce8b65bf4eb456a22375945294"
		},
		"pipfile-spec": 6,
		"requires": {
			"python_version": "3.7"
		},
		"sources": [{
			"name": "pypi",
			"url": "https://pypi.org/simple",
			"verify_ssl": true
		}]
	},
	"default": {
		"snip": "...",
		"aws-cdk.aws-route53": {
			"hashes": [
				"sha256:5b8854fa1b873eddcf89c73b5f444d306cb3d3089003c4c5a4830ca4242b0632",
				"sha256:9be9e1fffdfb9612b45ed8ff2ef275417bc83d3a25b150108d106b49c1f413ea"
			],
			"index": "pypi",
			"version": "==1.9.0"
		},
		"snip2": "..."
	},
	"snip": "..."
}

@SomayaB SomayaB added language/python Related to Python bindings management/devenv Related to CDK development/build environment labels Oct 10, 2019
@SomayaB
Copy link
Contributor

SomayaB commented Oct 10, 2019

Thanks @mikelane! 👍 @olivier-schmitt Is this what you were looking for?

@SomayaB SomayaB added guidance Question that needs advice or information. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 10, 2019
@olivier-schmitt
Copy link
Author

Yep !

@SomayaB SomayaB closed this as completed Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information. language/python Related to Python bindings management/devenv Related to CDK development/build environment
Projects
None yet
Development

No branches or pull requests

5 participants