-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Cross-platform Pipenv.lock? #3902
Comments
use |
it doesn't seem to work
alex@pop-os:~/py1$ diff ../py-win/Pipfile.lock Pipfile.lock
4c4
< "sha256": "828b8ad012f4c8773e6e61e3ac2be0ffcd7540fd7ed175a8355676c8e31c4d3d"
---
> "sha256": "c4a1bdfad8e2d208344003d9c704432100fbcb9bd87f713178895637222767a4"
33c33
< "colorama": {
---
> "hello-world": {
35,36c35
< "sha256:05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d",
< "sha256:f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"
---
> "sha256:f236ab36224613dff8db190dc4a02b3787c3d19e95f7e0876e3098966118bc1e"
38,39c37,38
< "markers": "sys_platform == 'win32'",
< "version": "==0.4.1"
---
> "index": "pypi",
> "version": "==0.2" |
Would you like to try the master branch? |
What's the simplest way to install it? |
@AlexP11223 If you are on mac: |
Looks like it works in master:
alex@pop-os:~/py2$ diff ../py-win/Pipfile.lock Pipfile.lock
4c4
< "sha256": "828b8ad012f4c8773e6e61e3ac2be0ffcd7540fd7ed175a8355676c8e31c4d3d"
---
> "sha256": "c4a1bdfad8e2d208344003d9c704432100fbcb9bd87f713178895637222767a4"
39a40,46
> },
> "hello-world": {
> "hashes": [
> "sha256:f236ab36224613dff8db190dc4a02b3787c3d19e95f7e0876e3098966118bc1e"
> ],
> "index": "pypi",
> "version": "==0.2" |
btw looks like Poetry handles it better by default, it doesn't remove dependencies for other platforms https://gist.github.com/AlexP11223/afbe247175efdcc897930d8c6ab04184 Maybe pipenv should consider this too? |
@AlexP11223 |
I mean that it should be the default behavior (otherwise someone will forget to add it sooner or later), not hidden under some switch with an unrelated name (which probably does more than just keeping dependencies marked as for other platforms). |
Platform dependent |
For anyone that may have initially thought to use
Probably most people read it that way to begin with, but not I, for whatever reason. Maybe worth scanning your the diff of your |
- Updated Pipfile and Pipfile.lock - Added `pipenv lock --keep-outdated` to automated workflows to support cross-platform deployment. See pypa/pipenv#3902.
@jamesstidard Sorry, but it is not clear for me how to handle cross-platform dependencies. Let me introduce my case.
So, I concluded that I need different dependency trees for different platform. By the way, I checked Am I doing something wrong or it is another case? |
@RomanSteinberg Looks like you're doing the right steps. The only thing I can thing is: are you running
Instead of:
Otherwise, I'm not sure, looks like you're doing the same steps as me. Sorry. EDIT: on rereading, both your ubuntu and macOS are failing with the same missing dependancy, so this is maybe unrelated to it being a platform specific dependancy and maybe a problem with the package itself. |
Using your recipe I failed again. :(
As far as I understand, this package has different versions for different platforms. May be it is maintainers problem but it becomes mine. So, I should store Pipfile.lock for each platform separately. |
I suspect you may be reporting about this issue: #5130 |
I am creating a cross-platform Python app.
While trying to build the app on Windows and Linux I noticed that
Pipenv.lock
is platform-specific.For example, I create a project on Windows and add
pytest
, it hascolorama
with"markers": "sys_platform == 'win32'"
in the lock file. But when modifying the lock file on Linux, such as adding a new lib (pipenv install hello-world
), this dependency will disappear.Here is the full output on both systems: https://gist.github.com/AlexP11223/6457fd4c98272c526c855c63088c00d4
Is it supposed to work like that? If yes, what is the best way to handle that for cross-platform apps? Is there any better solution than just committing lock files for all platforms to the Git repo (such as
Pipenv-win.lock
,Pipenv-linux.lock
) and renaming one of them toPipenv.lock
when building?Pipenv version:
'2018.11.26'
Pipenv location:
'C:\\Users\\user\\AppData\\Roaming\\Python\\Python37\\site-packages\\pipenv'
Python location:
'c:\\python37\\python.exe'
Python installations found:
3.7.3
:C:\Python37\python.exe
PEP 508 Information:
Pipenv version:
'2018.11.26'
Pipenv location:
'/home/alex/.local/lib/python3.7/site-packages/pipenv'
Python location:
'/usr/bin/python3'
Python installations found:
3.7.3
:/usr/bin/python3.7
3.7.3
:/usr/bin/python3.7m
2.7.16
:/usr/bin/python
PEP 508 Information:
The text was updated successfully, but these errors were encountered: