Skip to content

Commit a1e2c34

Browse files
authored
improve sdist handling (#877)
* improve sdsit handling * fix changelog * fix pytest installation * install test dependencies extra * fix sdist
1 parent a1cfd6e commit a1e2c34

6 files changed

Lines changed: 24 additions & 14 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
- MODULE=openml
1717
matrix:
1818
- DISTRIB="conda" PYTHON_VERSION="3.5" SKLEARN_VERSION="0.21.2"
19-
- DISTRIB="conda" PYTHON_VERSION="3.6" SKLEARN_VERSION="0.21.2"
19+
- DISTRIB="conda" PYTHON_VERSION="3.6" SKLEARN_VERSION="0.21.2" TEST_DIST="true"
2020
- DISTRIB="conda" PYTHON_VERSION="3.7" SKLEARN_VERSION="0.21.2" RUN_FLAKE8="true" SKIP_TESTS="true"
2121
- DISTRIB="conda" PYTHON_VERSION="3.7" SKLEARN_VERSION="0.21.2" COVERAGE="true" DOCPUSH="true"
2222
- DISTRIB="conda" PYTHON_VERSION="3.7" SKLEARN_VERSION="0.20.2"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ all: clean inplace test
99

1010
clean:
1111
$(PYTHON) setup.py clean
12-
rm -rf dist
12+
rm -rf dist openml.egg-info
1313

1414
in: inplace # just a shortcut
1515
inplace:

ci_scripts/install.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,24 @@ source activate testenv
3232
if [[ -v SCIPY_VERSION ]]; then
3333
conda install --yes scipy=$SCIPY_VERSION
3434
fi
35-
3635
python --version
37-
pip install -e '.[test]'
36+
37+
if [[ "$TEST_DIST" == "true" ]]; then
38+
pip install twine nbconvert jupyter_client matplotlib pytest pytest-xdist pytest-timeout \
39+
nbformat oslo.concurrency flaky
40+
python setup.py sdist
41+
# Find file which was modified last as done in https://stackoverflow.com/a/4561987
42+
dist=`find dist -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "`
43+
echo "Installing $dist"
44+
pip install "$dist"
45+
twine check "$dist"
46+
else
47+
pip install -e '.[test]'
48+
fi
49+
3850
python -c "import numpy; print('numpy %s' % numpy.__version__)"
3951
python -c "import scipy; print('scipy %s' % scipy.__version__)"
4052

41-
if [[ "$DOCTEST" == "true" ]]; then
42-
pip install sphinx_bootstrap_theme
43-
fi
4453
if [[ "$DOCPUSH" == "true" ]]; then
4554
conda install --yes gxx_linux-64 gcc_linux-64 swig
4655
pip install -e '.[examples,examples_unix]'

ci_scripts/test.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,8 @@ run_tests() {
1515

1616
cwd=`pwd`
1717
test_dir=$cwd/tests
18-
doctest_dir=$cwd/doc
1918

2019
cd $TEST_DIR
21-
if [[ "$EXAMPLES" == "true" ]]; then
22-
pytest -sv $test_dir/test_examples/
23-
elif [[ "$DOCTEST" == "true" ]]; then
24-
python -m doctest $doctest_dir/usage.rst
25-
fi
2620

2721
if [[ "$COVERAGE" == "true" ]]; then
2822
PYTEST_ARGS='--cov=openml'

doc/progress.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Changelog
1111

1212
* FIX #873: Fixes an issue which resulted in incorrect URLs when printing OpenML objects after
1313
switching the server
14+
* MAINT #767: Source distribution installation is now unit-tested.
15+
* MAINT #865: OpenML no longer bundles test files in the source distribution.
1416

1517
0.10.2
1618
~~~~~~

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
"Source Code": "https://github.com/openml/openml-python"
3636
},
3737
version=version,
38-
packages=setuptools.find_packages(),
38+
# Make sure to remove stale files such as the egg-info before updating this:
39+
# https://stackoverflow.com/a/26547314
40+
packages=setuptools.find_packages(
41+
include=['openml.*', 'openml'],
42+
exclude=["*.tests", "*.tests.*", "tests.*", "tests"],
43+
),
3944
package_data={'': ['*.txt', '*.md']},
4045
python_requires=">=3.5",
4146
install_requires=[

0 commit comments

Comments
 (0)