mgedmin / objgraph

Visually explore Python object graphs
http://mg.pov.lt/objgraph/
MIT License
753 stars 72 forks source link

Change setup.py to only want mock for Python 2.7 #44

Closed kmosiejczuk closed 4 years ago

kmosiejczuk commented 4 years ago

(Code will use built-in unittest.mock for 3.5+)

mgedmin commented 4 years ago

Thanks!

mgedmin commented 4 years ago

FWIW this makes older setuptools versions (like 19.x.x) very unhappy.

(Ask me how I know.)

kmosiejczuk commented 4 years ago

Oh no. How does it make it unhappy? (Asking so I can maybe look into doing this in a way that it likes)

mgedmin commented 4 years ago
error in objgraph setup command: 'tests_require' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in mock;python_version=="2.7" at ;python_version=="2.7"
kmosiejczuk commented 4 years ago

Looks like python_version was introduced 20.2 https://setuptools.readthedocs.io/en/latest/history.html#id379 I found some earlier PEPs that indicate it might work, but I'm having no success.

Looking at: https://www.python.org/dev/peps/pep-0345/#environment-markers It seems like using that older style with Requires-Dist might work, except that would make it a general dependency, not a test dependency.

Is this setuptools issue a big problem? I could spend more time on it if need be.

mgedmin commented 4 years ago

No, I just wanted to make a note in case users started filing bug reports.

I intend to do nothing unless users start filing bug reports, in which case I'll probably revert the change (and possibly drop support for python setup.py test entirely, tox is much better).