Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Improve Python version check for enum34 install #242

Merged
merged 1 commit into from
Feb 23, 2019

Conversation

ajoubertza
Copy link
Member

Older versions of distutils don't handle the extended version dependency syntax. E.g. default packages on Ubuntu 14.04 fail, while Ubuntu 16.04 works. Use the sys module's version instead.

Failures look like this when trying to build a Debian package:

error in pytango setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
E: pybuild pybuild:256: clean: plugin distutils failed with: exit code=1: python2.7 setup.py clean 
dh_auto_clean: pybuild --clean -i python{version} -p 2.7 --dir . returned exit code 13

Older versions of distutils (e.g. Ubuntu 14.04 LTS) don't handle
this extended version dependency syntax.  Use the sys module's
version instead.
@ajoubertza
Copy link
Member Author

Any reviewers keen to have a look at this minor change? Please 🙂

@vxgmichel
Copy link
Contributor

I'm a bit confused about this issue, because setup.py is supposed to use setuptools and not distutils. What happens if one runs a simple python setup.py install on ubuntu 14?

@ajoubertza
Copy link
Member Author

@vxgmichel It seems to work and starts compiling the C code (still running). The error happens when trying to build a Debian package - we're using a slightly modified version of the official one: https://salsa.debian.org/science-team/pytango/tree/master/debian, targeting Ubuntu 14.04.
Maybe it is caused by pybuild?

@vxgmichel
Copy link
Contributor

What about python setup.py clean then?

@ajoubertza
Copy link
Member Author

@vxgmichel Running python setup.py clean works fine too (sorry for the delay).

@ajoubertza ajoubertza mentioned this pull request Feb 12, 2019
@jairomoldes
Copy link
Contributor

I don't see any problem. Seems like "sys.version_info" is a safe and portable way of checking python version.

@tiagocoutinho
Copy link
Contributor

I think the issue is that ubuntu 14.04 system packages are python 2.7.6 and setuptools 3.3.
Declaring platform specific dependencies feature only appeared in a more recent version of setuptools.

So far the only statement we have in PyTango is that we require python >= 2.7. Since we don't say anything about a minimum version of setuptools I am inclined to accept this PR unless anyone has any objection.

@ajoubertza
Copy link
Member Author

Thanks for reviews @tiagocoutinho and @jairomoldes.

@ajoubertza ajoubertza merged commit b432906 into develop Feb 23, 2019
@ajoubertza ajoubertza deleted the support-older-distutils-for-enum34-install branch February 23, 2019 16:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants