question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

different package versions for different python versions

See original GitHub issue

My application can work under either python2 or python3, but some requirements have different versions. (For example, ipython >=6 for python3, < 6 for python2.) If I specify ipython="*", pipenv lock will pick ipython==6.3.1 I tried specifying

ipython = {version = ">=6.3", markers="python_version >= '3'"}
ipython = {version = "<6", markers="python_version < '3'"}

but pipenv complains about re-using the identifier.

I’m not sure if this is possible; if so I could not find it in the documentation (and maybe that case should be made explicit in the documentation.) If it is not possible and is not intended to be, maybe that should also be said explicitly. Regards

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:28 (10 by maintainers)

github_iconTop GitHub Comments

8reactions
thernstigcommented, Jan 9, 2019

There are multiple ways it can be achieved with TOML. Which one is the best can be debated. Here is a quick solution:

ipython = [ {version = ">=6.3", markers="python_version >= '3'"},
            {version = "<6", markers="python_version < '3'"} ]

This is a normal array with inline tables, taken directly from the TOML spec.

7reactions
kalfacommented, Jun 26, 2018

@uranusjr can I know why this encouragement? It seems to me that a wrapper solution defeat the purpose of a Pipfile itself.

Why should someone who subscribes to the idea behind pipfile and pipenv, should then choose to use code to describe dependancy as a preferred/encouraged approach? Let’s do “that” until is possible otherwise: yes. But encouraging it, seems opposite to the purpose of the project. Am I missing your point?

I agree on the “if propose, at least propose doable” Although, use cases collection can be done with meta code, and doesn’t really change anything, while enriching the discussion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing multiple versions of a package
I'm wondering if it would be possible to implement something that allows installing and importing multiple versions of a package.
Read more >
Handling Multiple Versions of a Package in Python | by skippd
Recently we faced a problem in our project for handling multiple versions of a package. Here is the requirement.
Read more >
What if two python packages have different versions of ...
Only one version will be installed. · The first thing to check would be if version 2.0 is backwards compatible with 1.0, because...
Read more >
Managing Multiple Python Versions With pyenv
That's because you're installing the Python package globally, which is a real problem if another user comes along and wants to install a...
Read more >
How to manage multiple Python versions and virtual ...
If you wish to use multiple versions of Python on a single machine, then pyenv is a commonly used tool to install and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found