lanpa/tensorboardX

The license_file parameter is deprecated

hubutui opened this issue · 3 comments

/usr/lib/python3.11/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
!!

        ********************************************************************************
        The license_file parameter is deprecated, use license_files instead.

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

        See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
        ********************************************************************************

!!

Just update

license_file = LICENSE

to

license_files = LICENSE
lanpa commented

Hi, would you like to send a pull request?

BTW, why do you use pip install in the setup.py?

tensorboardX/setup.py

Lines 20 to 25 in 79a1758

class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
for r in requirements:
subprocess.run(f"pip install '{r}'", shell=True)
install.run(self)

We usually declare the requirements in install_requires and it's enough. This led to an error when I build the wheel file for ArchLinux with python -m build --wheel --no-isolation.

installing to build/bdist.linux-x86_64/wheel
running install
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
    python-xyz', where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Arch-packaged Python package,
    create a virtual environment using 'python -m venv path/to/venv'.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.
    
    If you wish to install a non-Arch packaged Python application,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. Make sure you have python-pipx
    installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
lanpa commented

@hubutui As for the PostInstallCommand issue, if I remember correctly, this is needed if using python setup.py install. (Maybe 5 years ago?) Any PRs are welcome!