classification
Title: distutils.core.setup does not let people set 'bugtrack_url'.
Type: Stage: resolved
Components: Distutils, Library (Lib) Versions: Python 3.7, Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Decorater, berker.peksag, dstufft, eric.araujo, lemburg, r.david.murray
Priority: normal Keywords:

Created on 2016-12-30 08:37 by Decorater, last changed 2016-12-31 02:55 by Decorater. This issue is now closed.

Messages (10)
msg284323 - (view) Author: Decorater (Decorater) * Date: 2016-12-30 08:37
So, I could have an example setup.py which sets a bugtrack url however using sdist and bdist_wheel on them produces this warning:

H:\Python\Python360\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url'
  warnings.warn(msg)

The issue with this is wanting to set or change the bug track url's for the particular packages using setup.py to generate a PKG-INFO file which explicitly sets the value.

Currently there is no way to modify the fields online anymore since probably like 3~4 months ago I before was able to do it for a little while without having to upload a PKG-INFO file.

Example setup.py that does this:

from setuptools import setup
import re

requirements = []
try:
    with open('requirements.txt') as f:
        requirements = f.read().splitlines()
except Exception as ex:
    with open('sasync.egg-info\requires.txt') as f:
        requirements = f.read().splitlines()

version = '0.0.1'

if not version:
    raise RuntimeError('version is not set')

with open('README') as f:
    readme = f.read()

setup(name='examplepackage',
      author='Decorater',
      author_email='seandhunt_7@yahoo.com',
      url='https://github.com/AraHaan/examplepackage',
      bugtrack_url='https://github.com/AraHaan/examplepackage/issues',
      version=version,
      packages=['sasync'],
      license='MIT',
      description=('example package package demonstrating that bugtrack_url is not recognized by distutils.'),
      long_description=readme,
      maintainer_email='seandhunt_7@yahoo.com',
      download_url='https://github.com/AraHaan/examplepackage',
      include_package_data=True,
      install_requires=requirements,
      platforms='Any',
      classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'Intended Audience :: Other Audience',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Software Development :: Libraries :: Python Modules',
      ]
)
msg284331 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2016-12-30 14:07
I believe you need to report this problem to the setuptools maintainers. The stdlib distutils itself never defined a setup() argument 'bugtrack_url', so raises a warning when seeing this argument.
msg284333 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-12-30 15:51
Marc-Andre is correct. bugtrack_url is a distribute/setuptools specific option. Please report your problem to them.
msg284344 - (view) Author: Decorater (Decorater) * Date: 2016-12-30 20:19
The problem with setuptools on that is that they export their setup like so which uses the distutils setup by doing:

setup = distutils.core.setup. That is how they are doing it.
msg284345 - (view) Author: Decorater (Decorater) * Date: 2016-12-30 20:41
So basically what from setuptools import setup is really doing is the same as doing from distutils.core import setup
msg284346 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-12-30 20:58
Except that setuptools monkey patches distutiles all over the place.  So no, it isn't the same at all.
msg284349 - (view) Author: Decorater (Decorater) * Date: 2016-12-30 21:57
Except for the setup function, yeah. https://github.com/pypa/setuptools/blob/master/setuptools/__init__.py#L112
msg284351 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-12-30 22:50
Again, this is not a distutils bug and it has already been reported to the setuptools maintainers: https://github.com/pypa/setuptools/issues/29

Quoting from the original report:

> Currently setuptools.dist.Distribution passes the unfiltered collection
> of keyword arguments up to distutils.core.Distribution. This results in
> lots of scary looking "UserWarning" messages when you actually use the
> setuptools-only options

and see also:

> It also makes it look like you're calling distutils rather than setuptools,
> since the stack trace (showing that this is a call up into setuptools)
> isn't visible.

The setuptools maintainer replied (which he also maintains distutils):

> Indeed, setuptools just passes the attributes through directly through to Distribution. [...]

And by the way, I saw your own report while doing a research on this. Quoting from https://github.com/pypa/setuptools/issues/906

> [...] So that way setuptools can fix this bug as the standard library devs
> that manage distutils are too lazy to fix it themselves.

Next time I suggest you to do a better research before starting to blame the core developers.
msg284352 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2016-12-30 23:06
I did some more research: setuptools didn't have this keyword either.

It was added to PyPI at some point and then probably got picked up by some package authors as new "optional" keyword argument for setup():

http://stackoverflow.com/questions/14459828/how-to-set-bug-tracker-url-in-setup-py-script

There isn't anything we can do about this in the Python stdlib and neither can setuptools (except write a filter for it).

It's probably best to let the package authors still using the keyword know that they have to remove the keyword settings from their setup.py.
msg284357 - (view) Author: Decorater (Decorater) * Date: 2016-12-31 02:55
In that case why does pypi.python.org not let me change that bug track url option or set it anymore?
History
Date User Action Args
2016-12-31 02:55:22Decoratersetmessages: + msg284357
2016-12-30 23:06:33lemburgsetmessages: + msg284352
2016-12-30 22:50:23berker.peksagsetmessages: + msg284351
2016-12-30 21:57:26Decoratersetmessages: + msg284349
2016-12-30 20:58:42r.david.murraysetnosy: + r.david.murray
messages: + msg284346
2016-12-30 20:41:31Decoratersetmessages: + msg284345
2016-12-30 20:19:43Decoratersetmessages: + msg284344
2016-12-30 15:51:25berker.peksagsetstatus: open -> closed

nosy: + berker.peksag
messages: + msg284333

resolution: not a bug
stage: resolved
2016-12-30 14:07:09lemburgsetnosy: + lemburg
messages: + msg284331
2016-12-30 08:37:44Decoratercreate