Skip to content

lints: new black complains #1811

Closed

Description

@jku

Lint fails on CI currently

lint run-test: commands[0] | black --check --diff tuf/api tuf/ngclient examples tests
--- examples/repo_example/hashed_bin_delegation.py	2022-01-31 12:38:07.681056 +0000
+++ examples/repo_example/hashed_bin_delegation.py	2022-01-31 12:38:35.919966 +0000
@@ -72,11 +72,11 @@
 PREFIX_LEN = len(f"{(NUMBER_OF_BINS - 1):x}")  # ... 2.
 #
 # Compared to decimal, hexadecimal numbers can express higher numbers with
 # fewer digits and thus further decrease metadata sizes. With the above prefix
 # length of 2 we can represent at most ...
-NUMBER_OF_PREFIXES = 16 ** PREFIX_LEN  # ... 256 prefixes, i.e. 00, 01, ..., ff.
+NUMBER_OF_PREFIXES = 16**PREFIX_LEN  # ... 256 prefixes, i.e. 00, 01, ..., ff.
 #
 # If the number of bins is a power of two, hash prefixes are evenly distributed
 # over all bins, which allows to calculate the uniform size of ...
 BIN_SIZE = NUMBER_OF_PREFIXES // NUMBER_OF_BINS  # ... 8, where each bin is
 # responsible for a range of 8 prefixes, i.e. 00-07, 08-0f, ..., f8-ff.
would reformat examples/repo_example/hashed_bin_delegation.py

Oh no! 💥 💔 💥
1 file would be reformatted, 31 files would be left unchanged.
ERROR: InvocationError for command /home/runner/work/python-tuf/python-tuf/.tox/lint/bin/black --check --diff tuf/api tuf/ngclient examples tests (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   lint: commands failed
Error: Process completed with exit code 1.

Fixing this of course fails lint with older black but 🤷

Activity

  1. jku commented on Jan 31, 2022

    @jku
    MemberAuthor

    as a side note: I think we'll have to start pinning -dev requirements as well -- CI failures should not depend on when the CI run happens

  2. added
    1.0.0 blockers
    on Feb 1, 2022
  3. MVrachev commented on Feb 1, 2022

    @MVrachev
    Collaborator

    From what I understand, fixing this will require following the new black recommendations and pinning the current black version (which at the time of writing this is 22.1.0) inside requirements-dev.txt. @jku am I correct?

    If I am correct, then I can submit a pr for this today.

  4. jku commented on Feb 1, 2022

    @jku
    MemberAuthor

    Thank you. No need to pin as part of this PR (developers will have to wipe local tox caches, but that's just how tox works). A fix for repo_example is appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

1.0.0 blockers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions