Skip to content

Remove applications that depend on python2Packages#153151

Merged
dotlambda merged 23 commits intoNixOS:masterfrom
mweinelt:python2-removals
Jan 3, 2022
Merged

Remove applications that depend on python2Packages#153151
dotlambda merged 23 commits intoNixOS:masterfrom
mweinelt:python2-removals

Conversation

@mweinelt
Copy link
Member

@mweinelt mweinelt commented Jan 2, 2022

Motivation for this change

A first batch of application removals as well as python3 ports. Looked for application that depend on python2Packages.

#148779

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.05 Release Notes (or backporting 21.11 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.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jan 2, 2022
@veprbl
Copy link
Member

veprbl commented Jan 2, 2022

Courtesy pings:

@ofborg ofborg bot added the 8.has: clean-up This PR removes packages or removes other cruft label Jan 2, 2022
@ofborg ofborg bot requested review from Lassulus and danielfullmer January 2, 2022 03:27
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jan 2, 2022
@danielfullmer
Copy link
Contributor

No objection from me for removing pyrit. However, I don't believe we need to mark wifite2 as broken, since pyrit is only an optional dependency for wifite2.

@mweinelt
Copy link
Member Author

mweinelt commented Jan 2, 2022

No objection from me for removing pyrit. However, I don't believe we need to mark wifite2 as broken, since pyrit is only an optional dependency for wifite2.

There is a failing test without it.

======================================================================
ERROR: testAnalyze (test_Handshake.TestHandshake)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/source/tests/test_Handshake.py", line 27, in testAnalyze
    hs.analyze()
  File "/build/source/wifite/model/handshake.py", line 127, in analyze
    self.divine_bssid_and_essid()
  File "/build/source/wifite/model/handshake.py", line 38, in divine_bssid_and_essid
    pairs = self.pyrit_handshakes()  # Find bssid/essid pairs that have handshakes in Pyrit
  File "/build/source/wifite/model/handshake.py", line 109, in pyrit_handshakes
    return Pyrit.bssid_essid_with_handshakes(
  File "/build/source/wifite/tools/pyrit.py", line 28, in bssid_essid_with_handshakes
    pyrit = Process(command, devnull=False)
  File "/build/source/wifite/util/process.py", line 93, in __init__
    self.pid = Popen(command, stdout=sout, stderr=serr, stdin=stdin, cwd=cwd, bufsize=bufsize)
  File "/nix/store/rppr9s436950i1dlzknbmz40m2xqqnxc-python3-3.9.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/nix/store/rppr9s436950i1dlzknbmz40m2xqqnxc-python3-3.9.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pyrit'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/source/tests/test_Handshake.py", line 29, in testAnalyze
    exit()
  File "/nix/store/rppr9s436950i1dlzknbmz40m2xqqnxc-python3-3.9.9/lib/python3.9/_sitebuiltins.py", line 26, in __call__
    raise SystemExit(code)
SystemExit: None

It should be skipped because it is decorated with the following, but it isn't.

@unittest.skipUnless(Process.exists('pyrit'), 'pyrit is missing')

So I replaced that and it still tries to execute the test.

diff --git a/pkgs/tools/networking/wifite2/default.nix b/pkgs/tools/networking/wifite2/default.nix
index 44227dcce2a..9463c1c20c9 100644
--- a/pkgs/tools/networking/wifite2/default.nix
+++ b/pkgs/tools/networking/wifite2/default.nix
@@ -24,6 +24,11 @@ python3.pkgs.buildPythonApplication rec {
     })
   ];
 
+  postPatch = ''
+    substituteInPlace tests/test_Handshake.py \
+      --replace "@unittest.skipUnless(Process.exists('pyrit'), 'pyrit is missing')" "@unittest.skip"
+  '';
+
   propagatedBuildInputs = [
     aircrack-ng
     wireshark-cli

Feel free to push a fix.

@danielfullmer
Copy link
Contributor

@mweinelt I'm having trouble pushing my change to this branch. Either my permissions aren't sufficient or I'm doing it wrong. But feel free to cherry-pick this commit: danielfullmer@5a50edf

@dotlambda
Copy link
Member

Result of nixpkgs-review pr 153151 run on x86_64-linux 1

1 package blacklisted:
  • nixos-install-tools
2 packages built:
  • wifite2
  • zabbix-cli

Python2 user and unmaintained upstream since 2016.
Uses python2 and unmaintained in nixpkgs since introduced in 2018.

Upstream still maintains it, but it isn't easy to package, so we'll
remove it now.
Using python2 and abadoned upstream in 2020, last release in 2015.
Uses python2 and the upstream stopped maintaining it in 2017.
The maintainer hasn't interacted with this package since it was
introduced in 2017.
Uses python2 and the upstream has abandoned the project.
Uses python2 and abandoned by upstream.
Uses python2 and abandoned by upstream in 2012.
Stuck on python2, the upstream added a note to the projectes REAMDE to
watch out for a python3 version. Nothing ever came off it.
Uses python2 and abandoned by upstream.
mweinelt and others added 12 commits January 2, 2022 13:38
Uses python2 and abandoned by upstream.
Uses python2 and the upstream homepage is abandoned, the download link
is dead.
Requires python2 and no release in over two years to resolve the
situation.

```
./img2tiles.py -s font_interlace_variable.spec font_interlace_variable.tiles
  File "/build/blastem-3d48cb0c28be/./img2tiles.py", line 78
    print len(colors), 'distinct 9-bit colors in image'
          ^
SyntaxError: invalid syntax
```
Stuck on python2 and abandoned by upstream.
Stuck on python2 and last release in 2015.
Stuck on python2 and last release in 2010.
Stuck on python2 with last release in 2012.
> rawdog requires Python 2.7 or later, and not Python 3.

Have it your way!
Stuck on python2 and unmaintained since 2015.
Stuck on python2 and abandoned since 2017.
> "Programming Language :: Python :: 2.7 :: Only",
The latter was removed because it is stuck on python2.

Co-authored-by: Daniel Fullmer <[email protected]>
@thoughtpolice
Copy link
Member

Yes, look like tor-arm has reached the end of its road. Thanks for the heads up!

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff LGTM

@dotlambda dotlambda merged commit c020d0a into NixOS:master Jan 3, 2022
@Synthetica9
Copy link
Member

Should probably mention this in the release notes for 22.05

@womfoo womfoo mentioned this pull request Jan 3, 2022
13 tasks
@mweinelt mweinelt deleted the python2-removals branch January 12, 2022 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: clean-up This PR removes packages or removes other cruft 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants