Skip to content

Restoreref2#408

Open
andreafrancia wants to merge 41 commits into
masterfrom
restoreref2
Open

Restoreref2#408
andreafrancia wants to merge 41 commits into
masterfrom
restoreref2

Conversation

@andreafrancia

Copy link
Copy Markdown
Owner

No description provided.

curious-rabbit and others added 30 commits July 7, 2026 08:25
…can Faked in test instead of multiple funcionts.
The idea is to reduce the need of using doubles of internal collaborator
of RestoreCmd and work almost only on the file system. The file system
for tests for now is only a real fs, these changes will lead to ability
to use also a fake fs.

Other changes:
 - added tested features to FakeTrashDir
 - added features to MyPath
Modern mypy dropped Python 2 checking (removed in 0.980), so this pins an
old mypy (0.971, the last version with --py2 support) in its own venv,
along with the last Python-2-compatible release of the six stubs (later
typeshed releases dropped Python 2 support too). psutil never had Python 2
stubs at all, so it's ignore-listed via a dedicated mypy config.
PermissionError doesn't exist in Python 2's builtins; the NameError catch
already handles that correctly at runtime, but mypy's --py2 mode has no
way to know the name is deliberately version-conditional.
The second loop reused the name "index" from the first loop over
user-supplied strings. Old mypy (used for the Python 2 type-check) doesn't
re-infer the type on reuse, so it kept treating the variable as str and
flagged the later "in acceptable_values" (an xrange) check as invalid.
Scripts.__init__ used real PEP 3107 annotation syntax (fs: ScriptFs),
which is a hard SyntaxError on Python 2.7 - it doesn't just fail type
checking, it breaks collection for every test that transitively imports
this module (18 collection errors in CI). Switched to the type-comment
style already used everywhere else in this file.
print was passed as a bare callable (BumpCmd(os.system, print, ...)),
which only works if print is a function rather than a statement. Add
the future import so this actually works on Python 2.7 too.
I removed the .python-version file that seems to generate confusion
while the "Test sdist creation" workflow run.

The reported error is:

Error: The version '3.10
  3.14' with architecture 'x64' was not found for Ubuntu 24.04.

Link to a recent failure: https://github.com/andreafrancia/trash-cli/actions/runs/29209351404/job/86694285276?pr=407
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant