Skip to content

Conversation

@kurtmckee
Copy link

Hello! Thanks for your work on python-slugify!

slugify's packaging is using a number of deprecated constructs, and building and installing the package throws a number of deprecation warnings. This PR resolves all of the warnings that I was seeing.

  • Remove deprecated codecs.open() usage

    codecs.open() is deprecated and throws a DeprecationWarning:

    <string>:20: DeprecationWarning: codecs.open() is deprecated. Use open() instead.
    <string>:23: DeprecationWarning: codecs.open() is deprecated. Use open() instead.
    
  • Remove the unknown tests_require option

    The tests_require option throws a UserWarning:

    /.../site-packages/setuptools/_distutils/dist.py:289:
    UserWarning: Unknown distribution option: 'tests_require'
      warnings.warn(msg)
    
  • Resolve deprecated License trove classifier usage

    This resolves build warnings thrown by setuptools:

    /.../site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
    !!
    
            ********************************************************************************
            Please consider removing the following classifiers in favor of a SPDX license expression:
    
            License :: OSI Approved :: MIT License
    
            See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
            ********************************************************************************
    
    !!
    
  • Resolve deprecation warnings thrown when installing in editable mode

    Running pip install -e. displays the following deprecation warnings:

    DEPRECATION: Legacy editable install of python-slugify==8.0.4
    from file:///.../pr-python-slugify (setup.py develop) is deprecated.
    pip 25.3 will enforce this behaviour change.
    A possible replacement is to add a pyproject.toml
    or enable --use-pep517, and use setuptools >= 64.
    If the resulting installation is not behaving as expected,
    try using --config-settings editable_mode=compat.
    Please consult the setuptools documentation for more information.
    Discussion can be found at https://github.com/pypa/pip/issues/11457
    

With these changes, it's now possible to build and install the package without any warnings. Example:

# Building the package no longer throws warnings:
python -m pip install build
python -m build

# Installing in editable mode no longer throws warnings:
python -m pip install -e.

Warning

Running commands like python setup.py bdist_wheel is deprecated and may start failing at the end of this month. I strongly recommend migrating off of an executable setup.py file entirely, in favor of a declarative pyproject.toml file.

$ python setup.py bdist_wheel
...
/.../lib/python3.13/site-packages/setuptools/_distutils/cmd.py:90: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        By 2025-Oct-31, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!

`codecs.open()` is deprecated and throws a `DeprecationWarning`:

```
<string>:20: DeprecationWarning: codecs.open() is deprecated. Use open() instead.
<string>:23: DeprecationWarning: codecs.open() is deprecated. Use open() instead.
```
The `tests_require` option throws a `UserWarning`:

```
/.../site-packages/setuptools/_distutils/dist.py:289:
UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
```
This resolves build warnings thrown by setuptools:

```
/.../site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

        ********************************************************************************
        Please consider removing the following classifiers in favor of a SPDX license expression:

        License :: OSI Approved :: MIT License

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
        ********************************************************************************

!!
```
Running `pip install -e.` displays the following deprecation warnings:

```
DEPRECATION: Legacy editable install of python-slugify==8.0.4
from file:///.../pr-python-slugify (setup.py develop) is deprecated.
pip 25.3 will enforce this behaviour change.
A possible replacement is to add a pyproject.toml
or enable --use-pep517, and use setuptools >= 64.
If the resulting installation is not behaving as expected,
try using --config-settings editable_mode=compat.
Please consult the setuptools documentation for more information.
Discussion can be found at pypa/pip#11457
```
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