Skip to content

Commit 6439bfc

Browse files
committed
[cdd/tests/test_shared/test_pkg_utils.py] Use rpartial ; [.github/workflows/main.yml] Only release to PyPi when something other than tests changed ; [cdd/__init__.py] Bump version (last useless bump!)
1 parent 978264f commit 6439bfc

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,13 @@ jobs:
121121
if: (matrix.python-version == '3.8' || matrix.python-version == '3.12') && matrix.os.name == 'Linux' && github.ref == 'refs/heads/master'
122122
- name: PyPi release
123123
run: |
124-
python -m pip install twine
125-
python setup.py sdist bdist_wheel
126-
python -m twine upload --repository pypi dist/*
124+
if ! git diff --exit-code -s HEAD~1 -- cdd/tests && git diff --exit-code -s HEAD~1 -- ':!cdd/tests' ; then
125+
echo '[warn] Only test(s) changed so not releasing to PyPi'
126+
else
127+
python -m pip install twine
128+
python setup.py sdist bdist_wheel
129+
python -m twine upload --repository pypi dist/*
130+
fi
127131
env:
128132
TWINE_USERNAME: __token__
129133
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}

cdd/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from logging import getLogger as get_logger
1010

1111
__author__ = "Samuel Marks" # type: str
12-
__version__ = "0.0.99rc41" # type: str
12+
__version__ = "0.0.99rc42" # type: str
1313
__description__ = (
1414
"Open API to/fro routes, models, and tests. "
1515
"Convert between docstrings, classes, methods, argparse, pydantic, and SQLalchemy."

cdd/tests/test_shared/test_pkg_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from unittest import TestCase
88

99
from cdd.shared.pkg_utils import get_python_lib, relative_filename
10+
from cdd.shared.pure_utils import rpartial
1011
from cdd.tests.utils_for_tests import unittest_main
1112

1213

@@ -24,7 +25,7 @@ def test_get_python_lib(self) -> None:
2425
site_packages: str = getsitepackages()[0]
2526
site_packages: str = next(
2627
filter(
27-
partial(eq, python_lib),
28+
rpartial(eq, python_lib),
2829
(
2930
lambda two_dir_above: (
3031
site_packages,

0 commit comments

Comments
 (0)