Skip to content

Commit a208fa4

Browse files
committed
MAINT: Use requirements
Use requirements in setup file Replace versioneer with setuptools_scm Small doc fixes
1 parent e83355e commit a208fa4

29 files changed

+75
-2442
lines changed

.codacy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ engines:
55
python_version: 3
66
exclude_paths:
77
- '**/_version.py'
8-
- 'versioneer.py'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ docs/source/savefig
1515
docs/gettingstarted_0.png
1616
examples/executed
1717

18+
#setuptools-scm generated version file
19+
statsmodels/_version.py
1820
# generated c source and built extensions
1921
*.c
2022
*.so

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ before_install:
9898

9999
# Install packages
100100
install:
101-
# Bug in NumPy < 1.16.1 that raises ValueError on size mismatch
102-
- if [[ ${NUMPY} != "1.15" ]]; then pip install -e .; else python setup.py develop; fi
101+
- pip install -e .
103102

104103
before_script:
105104
- if [[ ${DOCBUILD} = true ]]; then source tools/ci/docbuild_install.sh; fi;

INSTALL.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Installing
7171

7272
To get the latest release using pip
7373

74-
pip install statsmodels --upgrade-strategy only-if-needed
74+
python -m pip install statsmodels --upgrade-strategy only-if-needed
7575

7676
The additional parameter pip --upgrade-strategy only-if-needed will ensure
7777
that dependencies, e.g. NumPy or pandas, are not upgraded unless required.
@@ -82,7 +82,7 @@ Ubuntu/Debian
8282
On Ubuntu you can get dependencies through:
8383

8484
sudo apt-get install python python-dev python-setuptools python-numpy python-scipy
85-
pip install cython pandas
85+
python -m pip install cython pandas
8686

8787
Alternatively, you can install from the NeuroDebian repository:
8888

@@ -103,7 +103,7 @@ Or clone the bleeding edge code from our repository on github at
103103

104104
In the statsmodels directory do (with proper permissions)
105105

106-
python setup.py install
106+
python -m pip install .
107107

108108
You will need a C compiler installed.
109109

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
global-include *.csv *.py *.txt *.pyx *.pyx.in *.pxd *.pxi *.c *.h *.pkl
2+
include statsmodels/_version.py
23
include MANIFEST.in
34
include README.rst
45

@@ -25,5 +26,4 @@ recursive-include examples *
2526
prune */__pycache__
2627

2728
global-exclude *~ *.swp *.pyc *.pyo *.bak
28-
include versioneer.py
2929
include statsmodels/_version.py

appveyor.yml.bak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ build_script:
3636
- If Defined PY_MAJOR_VER ( call tools\ci\appveyor_conda.bat ) else ( call tools\ci\appveyor_pip.bat )
3737
# Pin to 1.29 for now due to test discovery issues
3838
- python -m pip install --upgrade pip "setuptools<50.0"
39-
- pip install pytest "pytest-xdist==1.29" pytest-randomly
40-
- if Defined PYTEST_DIRECTIVES ( pip install -e . --no-build-isolation ) else ( pip install . )
39+
- python -m pip install pytest "pytest-xdist==1.29" pytest-randomly
40+
- if Defined PYTEST_DIRECTIVES ( python -m pip install -e . --no-build-isolation ) else ( pip install . )
4141

4242
test_script:
4343
- call tools\ci\run_test.bat

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ of these with
1212

1313
```bash
1414

15-
pip install -e .[docs]
15+
python -m pip install -e .[docs]
1616

1717
```
1818

docs/source/conf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# serve to show the default.
1414

1515
import contextlib
16-
from distutils.version import LooseVersion
16+
from packaging.version import parse
1717
import os
1818
from os.path import dirname, join
1919
import sys
@@ -98,13 +98,13 @@
9898

9999
release = __version__
100100

101-
lv = LooseVersion(release)
101+
parsed_version = parse(release)
102102
commit = ''
103103
full_version = short_version = version = release
104-
if '+' in lv.version:
105-
short_version = lv.vstring[:lv.vstring.index('+')]
106-
commit = lv.version[lv.version.index('+') + 1]
107-
version = short_version + ' (+{0})'.format(commit)
104+
if parsed_version.is_devrelease:
105+
short_version = parsed_version.base_version
106+
commit = parsed_version.dev
107+
version = short_version + f' (+{commit})'
108108

109109
# Remove release to prevent it triggering a conf change
110110
del release

docs/source/dev/maintainer_notes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Releasing
174174

175175
5. Build a sdist to ensure that that the build is clean::
176176

177-
python setup.py sdist --formats=gztar
177+
python -m build --sdist .
178178

179179
It is important that the build on the tar.gz file is the same as the tag. It must not be **dirty**
180180

@@ -238,7 +238,7 @@ Once any patches have been backported to a maintenance branch, the release steps
238238

239239
5. Build a sdist to ensure that that the build is clean::
240240

241-
python setup.py sdist --formats=gztar
241+
python -m build --sdist .
242242

243243
It is important that the build on the tar.gz file is the same as the tag. It must not be **dirty**.
244244

docs/source/dev/test_notes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ using a development install of statsmodels by running:
1111

1212
.. code-block:: bash
1313
14-
pip install -e .
14+
python -m pip install -e .
1515
1616
from the root directory of the git repository. The flag ``-e`` is for editable.
1717

1818
This command compiles the C code and add statsmodels to your activate python
1919
environment by creating links from your python environment's libraries
2020
to the statsmodels source code. Therefore, changes to pure python code will
2121
be immediately available to the user without a re-install. Changes to C code or
22-
Cython code require rerunning ``pip install -e .`` before these changes are
22+
Cython code require rerunning ``python -m pip install -e .`` before these changes are
2323
available.
2424

2525
Test Driven Development
@@ -37,7 +37,7 @@ Like many packages, statsmodels uses the `pytest testing system <https://docs.py
3737
Running Tests
3838
-------------
3939
Test are run from the command line by calling ``pytest``. Directly running tests using
40-
pytest requires that statsmodels is installed using ``pip install -e .`` as described
40+
pytest requires that statsmodels is installed using ``python -m pip install -e .`` as described
4141
above.
4242

4343
Tests can be run at different levels of granularity:
@@ -165,7 +165,7 @@ speed up runs of the full test suite when needed.
165165

166166
.. code-block:: bash
167167
168-
pip install pytest-xdist
168+
python -m pip install pytest-xdist
169169
export MKL_NUM_THREADS=1
170170
export OMP_NUM_THREADS=1
171171
pytest -n auto statsmodels

0 commit comments

Comments
 (0)