Comments (9)
Is there any way to set the line endings during the file generation/copy?
Maybe have two versions of the file, detect the platform, then select the
correct file for the platform before the copy operation.
Original Comment By: Kelsey Hightower
from pip.
I've now fixed my own code to generate correct newlines for each platform.
But regardless of my file-generation script, I think that Windows users should
be getting CRLF files and Linux users should be getting LF files. I think it's
impolite to put LF files on a Windows user's computer.
Original Comment By: Ram Rachum
from pip.
I am glad you found a solution. Since python is cross platform, it will be
hard to know where an enduser will deploy your code or package. I would always
suggest detecting the platform and doing the right thing when possible.
Original Comment By: Kelsey Hightower
from pip.
So you agree that pip should prefer downloading a zip distribution over a
tar.gz one on Windows?
Original Comment By: Ram Rachum
from pip.
I would not think an installer should treat zip or tarballs differently, as
both could contain the same package/code. As a developer I would rather handle
that kind of logic myself. Just image the issues you would run into if you
left that up to the installer. You would have to make sure RPM, easy_install,
pip, and other installers all do the same thing.
Original Comment By: Kelsey Hightower
from pip.
I'm confused by your comment.
My suggestion is about the case where a package on PyPI has both a zip
source distribution and a tar.gz one available.
When you as a developer publish these two kinds of source distributions on
PyPI, it's your responsibility that both of the distributions work and that
users can use either of them randomly. Do you agree on this?
Since it's the developer's responsibility to make sure all the source
distributions work, it is the right of every installer (such as easy_install
or pip) to choose randomly which kind of source distribution it wants to use.
So if pip has a right to choose whichever source distribution it wants, why
not be polite to the OS and choose the one that is more likely to have newline
characters that are compatible with the OS's?
"As a developer I would rather handle that kind of logic myself"
I don't understand. Where would you handle that logic? Your package only gets
executed after pip installs it, so how could it have any control on which
distribution pip downloads? Possibly I've completely misunderstood your
statement.
Original Comment By: Ram Rachum
from pip.
In my personal projects I make sure both the zip and tar.gz versions work the
same.
"As a developer I would rather handle that kind of logic myself"
One way I would handle the logic myself would be to put OS specific stuff in
setup.py. For example, you can select a different set of files that get
installed depending on the OS platform. The same OS detection could occur
during execution as well.
Keep in mind I am only speaking for myself, not the core pip developers.
Original Comment By: Kelsey Hightower
from pip.
"So if pip has a right to choose whichever source distribution it wants, why
not be polite to the OS and choose the one that is more likely to have newline
characters that are compatible with the OS's?"
I tend to agree with this statement. I guess the question here is; What's
Pip's current policy on how it selects which distribution to install when the
only difference is the packaging format (zip vs tar.gz)?
Original Comment By: Kelsey Hightower
from pip.
I'm going to close this. I don't think picking different extensions on different OSs is a generally good idea.
from pip.
Related Issues (20)
- telegram.ext HOT 1
- -vv is not passed to build env install subprocesses
- How to use the `` --config-settings`` on the requirements
- zsh: command not found: pip HOT 2
- Documentation inconsistency in #DependencyResolution chapter HOT 1
- CodeQL SAST scanning for pip repository HOT 1
- `pip install *.tar.gz[optional_dep]` cause glob to fail HOT 3
- Cache wheel files retrieved from HTTP cache
- Performance Issue: Too many hashes in RequirementPreparer
- `pip debug` causes `AttributeError` in Python 3.13
- Strange backtracking HOT 10
- Version upgrade failed HOT 2
- Compatibility with uv and relative imports HOT 7
- More robust shebang manipulation HOT 4
- I can't install autoviz HOT 2
- impossible to install from http git with authentication on windows HOT 12
- Pip install `--dry-run` shouln't download full wheels when metadata file available HOT 8
- installs + compiles multiple times HOT 2
- Versioned URLs for pip.pyz missing HOT 5
- Pip doesn't raise on package conflict in extras_require HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pip.