Skip to content

Conversation

Precioussheep
Copy link

Overview

Installing xkcdpass on pip 25.x raises the following warning:

DEPRECATION: Building 'xkcdpass' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized build interface by setting the `--use-pep517` option, (possibly combined with `--no-build-isolation`), or adding a `pyproject.toml` file to the source tree of 'xkcdpass'. Discussion can be found at https://github.com/pypa/pip/issues/6334

This pull request provides pyproject.toml support.

What has changed?

  • setup.py file have been removed;
  • pyproject.toml file has been added with a setuptools build backend

Will this change functionality?

Yes, in the following ways

  • pyproject.toml based builds do not support python2, so this will have to be dropped.

The requires-python >= 3.6 is arbitrary, this can be adjusted if we believe older versions still need support.

How do I build and deploy this now?

Using build and twine

  • Install the build dependencies
pip3 install build twine
  • Build the package
python3 -m build .
  • Upload the package
twine upload dist/*

Did you test this?

Yes, in the following manner:

  1. Build the package ---> python3 -m build .
  2. Install to local venv
  3. Move test script to somewhere it can't locally pickup the local dist folder
  4. Run the test python3 test_xkcdpass.py

1 test failed, same as the current version on pypi.

test_acrostic (__main__.XkcdPasswordTests.test_acrostic) ... ok
test_delim (__main__.XkcdPasswordTests.test_delim) ... ok
test_loadwordfile (__main__.XkcdPasswordTests.test_loadwordfile) ... FAIL
test_random_delimiter (__main__.XkcdPasswordTests.test_random_delimiter) ... ok
test_regex (__main__.XkcdPasswordTests.test_regex) ... ok
test_set_case (__main__.XkcdPasswordTests.test_set_case) ... ok
test_emits_no_separator_when_specified_separator_empty (__main__.TestEmitPasswords.test_emits_no_separator_when_specified_separator_empty)
Should emit no separator when empty separator specified. ... ok
test_emits_specified_count_of_passwords (__main__.TestEmitPasswords.test_emits_specified_count_of_passwords)
Should emit passwords numbering specified `count`. ... ok
test_emits_specified_separator_between_passwords (__main__.TestEmitPasswords.test_emits_specified_separator_between_passwords)
Should emit specified separator text between each password. ... ok

======================================================================
FAIL: test_loadwordfile (__main__.XkcdPasswordTests.test_loadwordfile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/[..]/XKCD-password-generator/tests/test_xkcdpass.py", line 32, in test_loadwordfile
    self.assertEqual(len(self.wordlist_full), 29611)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 5670 != 29611

----------------------------------------------------------------------
Ran 9 tests in 0.037s

FAILED (failures=1)

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