-
Notifications
You must be signed in to change notification settings - Fork 35
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
Current status of the Obsoletes metadata? #154
Comments
I'm noticing that |
It's Option 4 - the problem we have with Obsoletes-Dist is that it means that a hostile fork can claim that it obsoletes the existing project even when the maintainers of the original project disagree. The proposed replacement is an There isn't a currently active doc that discusses that, but earlier versions of PEP 426 had draft definitions for new (Marking completely defunct projects as obsolete would need to be handled via a different mechanism that didn't require a new release of the obsolete project, but I figure if we ever do that it will be better handled as an online service, potentially even part of Warehouse, with an explicit governance process akin to PEP 541's handling of name reassignments) |
This situation already exists, because right now what happens is that if two packages provide the same importable name, $ pip install ./test_obsoletes
...
$ python -c 'import testpkg'
Obsoletes
$ pip install ./test_obsoleted
...
$ python -c 'import testpkg'
Obsoleted
$ pip uninstall testpkg0
...
$ pip freeze
testpkg==0.0.2
$ python -c 'import testpkg'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'testpkg' The only difference that having The So, basically, you can already do an "obsoleted by", you can also silently do the dangerous thing of overwriting another package's importable name. What you can't do is do the responsible thing and say, "Hey actually this package is intended to be an upgrade of that other package, which is why they're not intended to be installed side-by-side." The idea that you could just "obsolete" some random package was also my first concern, but in the end I think it's relatively minor. njs on #pypa (my guess was that that's @njsmith but I could be wrong) had a more compelling alternative, which is to widen the field to just |
There was some discussion of this in #pypa today, that seems relevant enough to paste here:
|
For the current ability to silently corrupt an installation, I think that's a missing feature in I do think a On some other points:
|
Yes, this is a whole can of worms to open, honestly. It probably needs to be opened at some point, but this causes a lot of headaches at my day job when we use DPKG, which, sensibly, prevents two packages from installing the same file in the same location. Since In the end something reasonable has to happen and it might involve warnings and reference counts or something, but I think I would propose that we work out a plan for |
Though I guess @njsmith 's point in the chat about how "Obsoletes" might not be conflicting, it might just be that one is deprecated in favor of the other still needs to be addressed. That may weigh in favor of "Obsoletes" being just a warning until "Conflicts" comes around. That said, I'm not really sure why you need to mark deprecation at the packaging metadata level. That can easily be handled at runtime, on websites, etc. The main reason to include it in the packaging metadata is when it's actually a problem to install them at the same time, which would argue in favor of the "special case of Conflicts" approach. |
Is there a currently supported mechanism that can be used to handle package renames like with the |
+1 for |
Conflicts-Dist is a good solution. It would have saved me hours of work debugging an error which was caused by pipenv intermitantly installing either |
…atibility with ZODB4 and ZODB5 This depend-only eggs have to be installed manually for forward-compatibility with ZODB4 and ZODB5, so that e.g. installing any egg that depends on 'ZODB' (not 'ZODB3') will not pull in ZODB5. Example of those eggs are zodbtools, zodburi, ... Unfortunately there is no way for this to work automatically - for example there is 'provides' and 'provides-dist' setup keywords and corresponding metadata, but no Python package manager actually supports that: https://packaging.python.org/specifications/core-metadata/#rarely-used-fields https://www.python.org/dev/peps/pep-0314/#provides-multiple-use https://www.python.org/dev/peps/pep-0345/#provides-dist-multiple pypa/packaging-problems#154 (obsoletes/provides not supported)
From a question on the PyPA IRC, I looked into how one would specify that one project obsoletes another one (such as when the PyPI name changes but the package provides the same importable name). It seems that
setuptools
supports theobsoletes
keyword and will successfully produce aPKG-INFO
with the right information, you can use the following example to test this:Steps to reproduce:
1. Create initial packages:
Result:
2. Populate the
setup.py
:test_obsoletes/setup.py:
test_obsoleted/setup.py:
3. Check the metadata
Looks like the
obsoletes
keyword properly produces theObsoletes
metadata:3. Make a virtualenv
python3.6 -m virtualenv temp source temp/bin/activate
4. Install the obsoleted package
Result:
5. Install the obsoleting package:
Result:
The current version of the distutils documentation indicates that you can use the
obsoletes
keyword, and indeed this does produce the right metadata, butpip
doesn't actually do anything with that information. I am guessing that this is becauseobsoletes
is deprecated, but is there no replacement for this? Is there no way to say, "You should not have both this package and that package installed at the same time"?The options I see:
pip
starts respectingObsoletes
and will uninstall packages obsoleted by what is currently being installed. This may cause things to break so there may need to be a temporary workaround to prevent conflicts from arising).pip
starts issuing warnings when an obsoleted package is present ("Hey this obsoletes X which you also have installed. You probably want to dopip uninstall X
"). Not sure how well this will work if the obsoleted and obsoleting packages provide the same files.distutils
andsetuptools
what the new way is, and start issuing deprecation warnings whenobsoletes
is found in asetup.py
.Obsoletes
was developed for.The text was updated successfully, but these errors were encountered: