New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRG: refactor and test setup.py #809

Merged
merged 9 commits into from Dec 30, 2015

Conversation

Projects
None yet
3 participants
@matthew-brett
Member

matthew-brett commented Dec 13, 2015

Refactor setup.py to work better with pip. Allow setuptools / pip installs
into systems that don't have Cython (Cython gets installed automatically).

Update requirements in requirements.txt file and info.py.

Check installation via sdist and wheels.

matthew-brett added some commits Dec 13, 2015

MAINT: add .buildbot.patch to .gitignore
.buildbot.patch is the file generated by ``try_branch.py`` to upload to
the buildmaster.
MAINT: update minimum requirements
Update info.py and requirements.txt with minimum requirements.

Add notes in relevant places to keep these in sync.
RF: Cythonize using in-process Cython
We want to be able to use Cython as installed for `setup_requires`, but
these installs do not put scripts on the path.  Therefore, use Cython's
functions to compile the script, rather than calling subprocess.
RF: refactor setup.py to be better with pip etc
Do more flexible run-time checking of dependencies to allow standard
dependency checking by pip etc.

Refactor getting stuff from info.py to make the code easier to check
with e.g. pyflakes.
TST: test different types of installs
Run through different install types in travis testing.
@arokem

This comment has been minimized.

Member

arokem commented Dec 17, 2015

Any idea why this hasn't triggered a Travis build?

@matthew-brett

This comment has been minimized.

Member

matthew-brett commented Dec 17, 2015

Yes, that's because I turned off the build for this commit because it was a trivial modification of the one tested here : https://travis-ci.org/matthew-brett/dipy/builds/96530773

Diff:

diff --git a/.gitignore b/.gitignore
index bacf6a7..579881e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,4 @@ __config__.py
 .DS_Store
 .coverage
 .buildbot.patch
+.eggs/
RF: rename distuils imports for clarity
Names of distutils commands getting a bit confused; make names more
explicit.

@matthew-brett matthew-brett force-pushed the matthew-brett:refactor-setup branch from 10204eb to 675ae05 Dec 17, 2015

@matthew-brett

This comment has been minimized.

Member

matthew-brett commented Dec 17, 2015

I pushed up a little refactor which has triggered a build.

setup.py Outdated
raise RuntimeError(ver_err_msg)
else: # Using setuptools
# Add packages to given section of setup/install_requires
if ver_err_msg != None or not heavy:

This comment has been minimized.

@arokem

arokem Dec 20, 2015

Member

What does heavy mean in this context?

This comment has been minimized.

@matthew-brett

matthew-brett Dec 20, 2015

Member

"Heavy" means that it's a pain to install from scratch.

In the code, it means that, if the package is installed already and has a
good-enough version, we don't add it to the setuptools requirements.

This avoids two undesirable cases:

  • installing e..g. scipy with pip just because the current installation was
    not installed with pip / setuptools;
  • upgrading e..g. scipy when upgrading dipy (pip by default upgrades all
    dependencies at the same time as the main package).
@arokem

This comment has been minimized.

Member

arokem commented Dec 20, 2015

Just took a look through everything. It seems good, though I have to admit that the distinctions between setuptools and distutils make my head spin. And the additional checks seem good to me. I had one small question, but otherwise, happy to merge this.

@arokem

This comment has been minimized.

Member

arokem commented Dec 21, 2015

Thanks for the explanation. If no one else pipes up, I will merge this in a couple of days.

matthew-brett added some commits Dec 22, 2015

RF: refactor dependency checking
Put more dependency-checking code into setup_helpers with more
documentation.
RF: refactor needs_cython check
Do needs_cython check in cythexts function, rather than working out the
result from the returned extension builder.

@matthew-brett matthew-brett force-pushed the matthew-brett:refactor-setup branch from c929c4b to 9a6fd10 Dec 22, 2015

Garyfallidis added a commit that referenced this pull request Dec 30, 2015

Merge pull request #809 from matthew-brett/refactor-setup
MRG: refactor and test setup.py

@Garyfallidis Garyfallidis merged commit b7e52e1 into nipy:master Dec 30, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment