1

I use setuptools and a requirements file to satisfy dependencies for my open source module.

Example setup.py:

from setuptools import setup, find_packages
from pip.req import parse_requirements


# parse_requirements() returns generator of
# pip.req.InstallRequirement objects
install_reqs = parse_requirements('requirements.txt',
                                  session=False)

# reqs is a list of requirement
reqs = [str(ir.req) for ir in install_reqs]

setup(
    name='python-symphony',
    version='0.1.5',
    description='python module for symphony chat',
    author='Matt Joyce',
    author_email='matt@joyce.nyc',
    url='https://github.com/symphonyoss/python-symphony',
    license='Apache 2.0',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Build Tools',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
    ],
    keywords='symphony chat api python module',
    # install dependencies from requirements.txt
    install_requires=reqs,
    packages=find_packages(),
    # bin files / python standalone executable scripts
    include_package_data=True,
    zip_safe=False,
)

This has worked for some time. However, recently my builds have been breaking. I believe there is a bug in setuptools, possibly related to pygments.

There are two (thus far) identified failure states:

  1. It results in the package being installed as a binary wheel (despite no such package existing in PyPI).

  2. It results in the package installing in site-packages seemingly correctly, but none of the subclasses can be called from the module.

I can get it to work manually by removing the package from site packages and running:

pip install --isolated --no-cache-dir python-symphony

but this results in pygments getting messed up somehow. (I noticed this when trying to debug the module in bpython).

Trying to run this stuff from a venv (wrapped with a Bash script) tends to still fail.

Is anyone aware of a new / recent issue in setuptools that could be responsible for this sort of breakage?

setuptools version: setuptools-33.1.1.dist-info and newer

Ref:
github: https://github.com/symphonyoss/python-symphony
pypi: https://pypi.python.org/pypi/python-symphony/

jwodder
  • 54,758
  • 12
  • 108
  • 124
Matt Joyce
  • 2,010
  • 2
  • 20
  • 31
  • Installing & importing the package seems to work fine for me under Python 2.7.12, setuptools 35.0.2. Installation also works under Python 3.5.2, setuptools 35.0.2, but then imports fail because lines like "`from base import Base`" are interpreted as absolute imports in Python 3; you need to write them as "`from .base import Base`" instead. I'm not clear on what problem #1 is supposed to be about; I'm pretty sure that if a PyPI package only has an sdist, pip will use the sdist to build a wheel and then install that. – jwodder May 22 '17 at 22:17
  • thought i had gotten all of those... odd that they aren't coming up in unit tests. will take a look. – Matt Joyce May 22 '17 at 23:28

0 Answers0