ericmandel / pyds9

Python connection to SAOimage DS9 via XPA
76 stars 41 forks source link

Use setuptools #18

Closed cdeil closed 8 years ago

cdeil commented 9 years ago

I'm getting this warning:

/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)

@montefra – I think it's because pyds9 uses distutils, and the solution is to switch to setuptools?

montefra commented 9 years ago

We could. But it is not necessary:

Probably the best solution is a try/except block: if setuptools exists use it, otherwise use distutils

cdeil commented 9 years ago

The official Python packaging recommendation is to use setuptools: https://packaging.python.org/en/latest/current.html#packaging-tool-recommendations

I'm not a packaging expert, but I think setuptools provides several goodies like e.g. making it easy to integrate the test runner and docs build via setup.py, and I think (but am not sure) it would be painful to do this with distutils. https://pytest.org/latest/goodpractises.html#integration-with-setuptools-test-commands

Of course it's not a necessity, but all Astropy affiliated packages do this, i.e. this works:

python setup.py test
python setup.py build_sphinx

i.e. it's easy and quick for Astropy devs like me to get started contributing to pyds9 if we set it up the same way.

montefra commented 9 years ago

@cdeil: thanks for the links. I'm looking into moving to setuptools. The only catch is that there is not clean module there. On the other end:

1) pip copy the package in a temporary directory and build it there 2) python setup.py build should build into build directory not touching the source directories.

I think that xpa library now is built in the xpa directory Leave some time to figure out how to deal with it. I'll do a PR.

python setup.py test

This I know

python setup.py build_sphinx

I think that I'll "borrow" it for my projects

montefra commented 8 years ago

this might come for free while dealing with #19

montefra commented 8 years ago

this is mostly done as part of #24. There are still few details to figure out, though.

montefra commented 8 years ago

The PR #28 should address and solve this

montefra commented 8 years ago

Done