Skip to content
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

python{27,310}Packages.deprecation: remove unittest2, break on Python 2 #202236

Merged
merged 2 commits into from
Dec 2, 2022
Merged

Conversation

tjni
Copy link
Contributor

@tjni tjni commented Nov 21, 2022

Description of changes

The deprecation package makes use of features from unittest only available since Python 3.4, but it also supports Python 2.7. It uses unittest2, which backports those features. Discussion about this is in briancurtin/deprecation#54.

We'd like to stop packaging unittest2 it since it is unmaintained and caused us some pain on Python 3.10, so we apply briancurtin/deprecation#57.

In the first commit, this PR applies the patch unconditionally (eating the rebuilds, since it's unclear if it will be accepted and released upstream) and also hides the unittest2 requirement inside of a python2-modules override.

In the second commit, this PR removes the python2-modules override, explicitly choosing to drop support for it in Python 2.

Related to #154264 and #154650.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@SuperSandro2000
Copy link
Member

Why do we want to target staging?

@tjni tjni changed the base branch from staging to master November 23, 2022 16:09
@tjni
Copy link
Contributor Author

tjni commented Nov 23, 2022

This was my bad, I assumed there would be more rebuilds than there were. I've retargeted the PR to master.

@dotlambda
Copy link
Member

hides the unittest2 requirement inside of a python2-modules override

No need to add that override. Python 2 (especially python2Packages) us no longer maintained.

@tjni tjni changed the title python{27,310}Packages.deprecation: constrain unittest2 to python2 python{27,310}Packages.deprecation: remove unittest, break on Python < 3.5 Dec 1, 2022
@tjni tjni changed the title python{27,310}Packages.deprecation: remove unittest, break on Python < 3.5 python{27,310}Packages.deprecation: remove unittest, break on Python 2 Dec 1, 2022
@tjni
Copy link
Contributor Author

tjni commented Dec 1, 2022

@dotlambda Thanks for your review. I pushed an additional commit removing the override. I prefer to keep the two commits separate, as they each have their own purpose, but this should achieve what you want to see.

@tjni tjni changed the title python{27,310}Packages.deprecation: remove unittest, break on Python 2 python{27,310}Packages.deprecation: remove unittest2, break on Python 2 Dec 1, 2022
@SuperSandro2000 SuperSandro2000 merged commit 0971493 into NixOS:master Dec 2, 2022
@tjni tjni deleted the deprecation branch December 2, 2022 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants