Repository navigation
BLD: Refactor Setup - #4871
BLD: Refactor Setup#4871
Conversation
| E114 | ||
| # E114: Indentation is not a multiple of four (comment) | ||
|
|
||
| [versioneer] |
There was a problem hiding this comment.
Can we adopt a convention of putting two blank lines between blocks? In particular I'm thinking [coverage:run] and [coverage:report] should have 1 blank line, so more-distinct blocks can have one more line.
Obviously, not a big deal.
| # no setuptools installed | ||
| from distutils.core import setup, Command | ||
| _have_setuptools = False | ||
| from setuptools.command.build_ext import build_ext |
There was a problem hiding this comment.
Is this still for the "no setuptools installed" case? Is that still possible in this day and age?
There was a problem hiding this comment.
There are only 2 cases, Cython installed or setuptools installed.
There was a problem hiding this comment.
Yep, reading comprehension fail on my part, thanks.
| # Key Values that Change Each Release | ||
| ############################################################################### | ||
| SETUP_REQUIREMENTS = {'numpy': '1.11', # released March 2016 | ||
| 'scipy': '0.18', # released July 2016 |
There was a problem hiding this comment.
+1 for noting the release dates
| SETUP_REQUIRES = [k + '>=' + v for k, v in SETUP_REQUIREMENTS.items()] | ||
| INSTALL_REQUIRES = [k + '>=' + v for k, v in INSTALL_REQUIREMENTS.items()] | ||
|
|
||
| EXTRAS_REQUIRE = {'build': ['cython>=0.24'], |
There was a problem hiding this comment.
Should the 0.24.0 be written in Exactly One Place and with a release date comment?
|
|
||
| DISTNAME = 'statsmodels' | ||
| DESCRIPTION = 'Statistical computations and models for Python' | ||
| README = open(pjoin(os.getcwd(), 'README.rst')).read() |
There was a problem hiding this comment.
Does this leave an open file handle behind?
| file_stats = os.stat(source_name) | ||
| try: | ||
| os.utime(pyx_filename, ns=(file_stats.st_atime_ns, file_stats.st_mtime_ns)) | ||
| except AttributeError: |
There was a problem hiding this comment.
Is this a py2 vs py3 thing?
|
With a few comments, generally +1. Does the new setup.py pass strict linting? If so, please add it to the lint.sh file. |
|
Does this mean tools/cythonize.py can go? (and possibly cythonize.dat, cythonize_exclusions.dat)? |
Yes
Yes, these are no longer required. It is more-or-less as vanilla as it can get while handling the two important cases -- cython (or not) and deferred numpy. |
Codecov Report
@@ Coverage Diff @@
## master #4871 +/- ##
==========================================
+ Coverage 81.42% 81.42% +<.01%
==========================================
Files 581 581
Lines 90248 90249 +1
Branches 10093 10093
==========================================
+ Hits 73486 73489 +3
+ Misses 14476 14474 -2
Partials 2286 2286
Continue to review full report at Codecov.
|
08061f2 to
f387c32
Compare
b7e785b to
1baab03
Compare
|
Can this be made to stop the installation with an error message if numpy and scipy are older than the setup requirements? SETUP_REQUIREMENTS = {'numpy': '1.11', # released March 2016 |
|
While I think it is simpler to leave this up to pip/end users, I have added checks for the SETUP_REQUIREMENTS as minimum versions. |
|
last change looks good to me I'd like to try this locally, and then merge when green, within a few days. That leaves us still some time before the next release to see if there are any problems. |
Fix broken lint.sh Fix lnting errors in setup
Exclude versioneer provided file form coverage Add codacy configuration
Remove clean command and use git clean -xfd instead
Quick check to avoid upgrading very old NumPy or SciPy that are already installed
Ensure LICENSE is included in installed package
Remove unicode spaces from setup.cfg Add all versioneer files to codacy to avoid inspections
Change exit on git clean command Remove pyproject.toml to avoid confusing pip
Use abspath and __file__ to robustify path detection
Provide better guidance for using git clean
Include setup.cfg in install to pickup pytest settings SMall improvements to pytest settings
be7b268 to
02cd6e3
Compare
|
all green, merging @bashtage Thank you |
|
Way to go fellas, this is a big win. |
|
Thanks - I'm glad this has gotten in, it will simplify some of the testing in my downstream projects |
|
Great. Will you make a 0.9.1 release with this? |
|
@Danielhiversen |
MAINT: remove cythonize.py made unnecessary by #4871
|
When is this going to be available? Simple installation of statsmodels is failing in our Docker build because it requires numpy to be installed first. |
This version builds on #3195 and appears to work as required:
It tries to simplify as much as possible and to let other packages handle tasks they already handle, like letting Cython determine whether to recompile a pyx file.
It adds versioneer since a lot of setup is a bespoke version of what versioneer already does.