Fixups to exclude tests from the wheels (#315)

* fixups to exclude tests from the wheel file
* also exclude the test files even from the sdist tars
This commit is contained in:
Brian Kroth 2023-04-25 15:31:28 -05:00 коммит произвёл GitHub
Родитель e0e18b3003
Коммит f6058a1ed2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 41 добавлений и 16 удалений

Просмотреть файл

@ -180,21 +180,35 @@ dist: bdist_wheel
.PHONY: bdist_wheel
bdist_wheel: conda-env mlos_core/dist/mlos_core-*-py3-none-any.whl mlos_bench/dist/mlos_bench-*-py3-none-any.whl
mlos_core/dist/mlos-core-*.tar: build/conda-env.${CONDA_ENV_NAME}.build-stamp
mlos_core/dist/mlos-core-*.tar: mlos_core/setup.py mlos_core/MANIFEST.in $(MLOS_CORE_PYTHON_FILES)
rm -f mlos_core/dist/mlos-core-*.tar
cd mlos_core/ && conda run -n ${CONDA_ENV_NAME} python3 setup.py sdist --formats tar
ls mlos_core/dist/mlos-core-*.tar
! ( tar tf mlos_core/dist/mlos-core-*.tar | grep -m1 tests/ )
mlos_core/dist/mlos_core-*-py3-none-any.whl: build/conda-env.${CONDA_ENV_NAME}.build-stamp
mlos_core/dist/mlos_core-*-py3-none-any.whl: mlos_core/setup.py $(MLOS_CORE_PYTHON_FILES)
rm -f mlos_core/dist/mlos_core-*-py3-none-any.whl \
&& cd mlos_core/ \
&& conda run -n ${CONDA_ENV_NAME} python3 setup.py bdist_wheel \
&& cd .. \
&& ls mlos_core/dist/mlos_core-*-py3-none-any.whl
mlos_core/dist/mlos_core-*-py3-none-any.whl: mlos_core/dist/mlos-core-*.tar
rm -f mlos_core/dist/mlos_core-*-py3-none-any.whl
cd mlos_core/ && conda run -n ${CONDA_ENV_NAME} pip wheel --no-index --no-deps --wheel-dir dist dist/mlos-core-*.tar
ls mlos_core/dist/mlos_core-*-py3-none-any.whl
# Check to make sure the tests were excluded from the wheel.
! ( unzip -t mlos_core/dist/mlos_core-*-py3-none-any.whl | grep -m1 tests/ )
mlos_bench/dist/mlos-bench-*.tar: build/conda-env.${CONDA_ENV_NAME}.build-stamp
mlos_bench/dist/mlos-bench-*.tar: mlos_bench/setup.py mlos_bench/MANIFEST.in $(MLOS_BENCH_PYTHON_FILES)
rm -f mlos_bench/dist/mlos-bench-*.tar
cd mlos_bench/ && conda run -n ${CONDA_ENV_NAME} python3 setup.py sdist --formats tar
ls mlos_bench/dist/mlos-bench-*.tar
! ( tar tf mlos_bench/dist/mlos-bench-*.tar | grep -m1 tests/ )
mlos_bench/dist/mlos_bench-*-py3-none-any.whl: build/conda-env.${CONDA_ENV_NAME}.build-stamp
mlos_bench/dist/mlos_bench-*-py3-none-any.whl: mlos_bench/setup.py $(MLOS_BENCH_PYTHON_FILES)
rm -f mlos_bench/dist/mlos_bench-*-py3-none-any.whl \
&& cd mlos_bench/ \
&& conda run -n ${CONDA_ENV_NAME} python3 setup.py bdist_wheel \
&& cd .. \
&& ls mlos_bench/dist/mlos_bench-*-py3-none-any.whl
mlos_bench/dist/mlos_bench-*-py3-none-any.whl: mlos_bench/dist/mlos-bench-*.tar
rm -f mlos_bench/dist/mlos_bench-*-py3-none-any.whl
cd mlos_bench/ && conda run -n ${CONDA_ENV_NAME} pip wheel --no-index --no-deps --wheel-dir dist dist/mlos-bench-*.tar
ls mlos_bench/dist/mlos_bench-*-py3-none-any.whl
# Check to make sure the tests were excluded from the wheel.
! ( unzip -t mlos_bench/dist/mlos_bench-*-py3-none-any.whl | grep -m1 tests/ )
.PHONY: dist-test-env-clean
dist-test-env-clean:

3
mlos_bench/MANIFEST.in Normal file
Просмотреть файл

@ -0,0 +1,3 @@
# setuptools-scm has an issue that causes it to include all files in git in the sdist produced.
# Here we exclude test files.
prune **/tests

Просмотреть файл

@ -38,12 +38,13 @@ extra_requires = {
extra_requires['full'] = list(set(chain(extra_requires.values()))) # type: ignore[assignment]
# pylint: disable=duplicate-code
module_base_name = 'mlos_bench'
setup(
name='mlos-bench',
version=_VERSION,
packages=find_packages(),
packages=find_packages(exclude=[f"{module_base_name}.tests", f"{module_base_name}.tests.*"]),
package_data={
'mlos_bench': ['py.typed'],
module_base_name: ['py.typed', '**/*.pyi'],
},
install_requires=[
'mlos-core==' + _VERSION,

3
mlos_core/MANIFEST.in Normal file
Просмотреть файл

@ -0,0 +1,3 @@
# setuptools-scm has an issue that causes it to include all files in git in the sdist produced.
# Here we exclude test files.
prune **/tests

Просмотреть файл

@ -34,12 +34,13 @@ extra_requires = {
extra_requires['full'] = list(set(chain(extra_requires.values()))) # type: ignore[assignment]
# pylint: disable=duplicate-code
module_base_name = 'mlos_core'
setup(
name='mlos-core',
version=_VERSION,
packages=find_packages(),
packages=find_packages(exclude=[f"{module_base_name}.tests", f"{module_base_name}.tests.*"]),
package_data={
'mlos_core': ['py.typed'],
module_base_name: ['py.typed', '**/*.pyi'],
},
install_requires=[
'scikit-learn<1.2', # FIXME: temporarily work around some version mismatch issues (PR 850)

Просмотреть файл

@ -1,4 +1,7 @@
# vim: set ft=dosini:
[bdist_wheel]
universal = 1
[pycodestyle]
count = True
# E124: Closing bracket does not match indentation of opening bracket's line