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
pythonPackages.feedparser: 5.2.1 -> 6.0.1 #101635
Conversation
da541ad
to
1649c8d
Compare
Result of 1 package marked as broken and skipped:
6 packages failed to build:
21 packages built:
|
Fork of the existing feedparser package, branched since 6.x breaks Python 2.x compatiblity.
Ideally we would use tox, but upstream doesn't seem to include tox.ini in their sdist at the moment.
I think they fails are unrelated to this PR:
|
Note that the set of quodlibet packages is already broken at HEAD for an unrelated reason according to Hydra. tangogps builds fine locally, do you have a repro? ( |
1649c8d
to
9aea33f
Compare
feedparser = callPackage ../development/python-modules/feedparser { }; | ||
feedparser5 = callPackage ../development/python-modules/feedparser/5.x.nix { }; # For Python 2.x compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feedparser = callPackage ../development/python-modules/feedparser { }; | |
feedparser5 = callPackage ../development/python-modules/feedparser/5.x.nix { }; # For Python 2.x compatibility. | |
feedparser = if isPy3k then | |
callPackage ../development/python-modules/feedparser { }; | |
else | |
callPackage ../development/python-modules/feedparser/5.x.nix { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into doing that, but there are other reasons to split off feedparser5 separately. For example, octoprint right now is Py3k compatible but their setup.py requires feedparser<6.
We could likely patch octoprint in place, I suspect that this <6 requirement is just there for safety against incompatible version bumps. I don't feel strongly either way. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to avoid having many version of the same package
Pinning within python-modules is highly discouraged. This will potentially introduce incompatible versions in a user's environment as either the new pinned version or the original version will be imported at runtime, breaking one of the packages.
The preference to handling this is to relax version bounds in the "install_requires" field. (could be in setup.py, pyproject.toml, requirements or others). In most cases, packages are still compatible with small API changes which may warrant a major version bump. We use test suites to verify that the package still works correctly.
If the package is still incompatible with the latest major version, then the most proper way to handle this is make an issue with the upstream package to adopt the latest major version. Or if upstream is not very responsive, you are free patch the source to make it compatible.
In very few circumstances, two versions of the same package are allowed to exist if the packages are extremely difficult to package. Some examples of this are tensorflow, which has huge ecosystems built around it and is hard to package. Another is django, which has 2 actively developed versions, and large ecosystems built around each.
One exception to this is applications, due to the way buildPythonApplication
and toPythonApplication
functions work, the related derivations will not bleed dependencies between packages. If the package doesn't need to be imported by other python modules, then this package would be a good candidate to convert into application. You can look at https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/awscli/default.nix as an example of using an overlay within a python application.
Info on buildPythonApplication
can be found here.
Info on toPythonApplication
can be found here.
}; | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}; | |
} | |
}; | |
} |
sha256 = "1s8jm3dgqabgf8x96931scji679qkhvczlv3qld4qxpsicfgns3q"; | ||
}; | ||
|
||
doCheck = false; # No tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If tests are not available, then please use pythonImportsCheck
to import the most important modules. This isn't as good as unit tests, but will usually give a good indication of run-time errors. Please see pythonImportsCheck documentation for more information.
@@ -2032,6 +2032,7 @@ in { | |||
feedgenerator = callPackage ../development/python-modules/feedgenerator { inherit (pkgs) glibcLocales; }; | |||
|
|||
feedparser = callPackage ../development/python-modules/feedparser { }; | |||
feedparser5 = callPackage ../development/python-modules/feedparser/5.x.nix { }; # For Python 2.x compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feedparser5 = callPackage ../development/python-modules/feedparser/5.x.nix { }; # For Python 2.x compatibility. | |
feedparser_5 = callPackage ../development/python-modules/feedparser/5.x.nix { }; # For Python 2.x compatibility. |
feedparser = callPackage ../development/python-modules/feedparser { }; | ||
feedparser5 = callPackage ../development/python-modules/feedparser/5.x.nix { }; # For Python 2.x compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to avoid having many version of the same package
Pinning within python-modules is highly discouraged. This will potentially introduce incompatible versions in a user's environment as either the new pinned version or the original version will be imported at runtime, breaking one of the packages.
The preference to handling this is to relax version bounds in the "install_requires" field. (could be in setup.py, pyproject.toml, requirements or others). In most cases, packages are still compatible with small API changes which may warrant a major version bump. We use test suites to verify that the package still works correctly.
If the package is still incompatible with the latest major version, then the most proper way to handle this is make an issue with the upstream package to adopt the latest major version. Or if upstream is not very responsive, you are free patch the source to make it compatible.
In very few circumstances, two versions of the same package are allowed to exist if the packages are extremely difficult to package. Some examples of this are tensorflow, which has huge ecosystems built around it and is hard to package. Another is django, which has 2 actively developed versions, and large ecosystems built around each.
One exception to this is applications, due to the way buildPythonApplication
and toPythonApplication
functions work, the related derivations will not bleed dependencies between packages. If the package doesn't need to be imported by other python modules, then this package would be a good candidate to convert into application. You can look at https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/awscli/default.nix as an example of using an overlay within a python application.
Info on buildPythonApplication
can be found here.
Info on toPythonApplication
can be found here.
doCheck = false; | ||
propagatedBuildInputs = [ sgmllib3k ]; | ||
|
||
checkPhase = "python tests/runtests.py"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkPhase = "python tests/runtests.py"; | |
checkPhase = "${python.interpreter} tests/runtests.py"; |
support alternate interpreters
}; | ||
|
||
# lots of networking failures | ||
doCheck = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doCheck = false; | |
doCheck = false; |
If tests are not available, then please use pythonImportsCheck
to import the most important modules. This isn't as good as unit tests, but will usually give a good indication of run-time errors. Please see pythonImportsCheck documentation for more information.
Sorry, this is ending up being much more effort than I'm willing to put into a package version bump that I'm not even officially maintaining. I'll keep in mind some of the comments here for future Python derivations I might end up writing, but I don't think putting the burden on me to fix many instances of existing technical debt is fair when I'm just trying to get nixpkgs more up to date. Closing this PR to avoid sitting on it forever and discouraging other folks from trying to own that problem themselves. |
@delroth it's help mitigate users having broken packages at runtime. Sure, it's burdensome, and probably should have been included when initially added. But it's better to break during the build, than break at runtime. Also, when doing mass package updates, it's either myself or @FRidh trying to stabilize the entire package set, E.g. #101636 . So, it's still important to have packages which demonstrate breakages during build. |
Motivation for this change
Feedparser 6.0.1 was released on Sept 15. The 6.x branch is not compatible with Python 2.x anymore.
I found two packages in nixpkgs that do not work with 6.x at this point, with no upstream fix for either of them. To minimize breakage, I've kept feedparser 5.2.1 (current version) in nixpkgs as
pythonPackages.feedparser5
. I don't feel strongly about this (anything that doesn't have a plan to support Py3k in 2020 is probably not actively maintained anyway...), let me know if you'd rather me remove the relevant commits and break the reverse dependencies.I've also fixed the derivation to add a checkPhase.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)