From 50d14a9d7357fb0dde042d43e948973c417453b1 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Fri, 15 Mar 2024 20:57:02 -0400 Subject: [PATCH] [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!) --- .github/workflows/main.yml | 10 +++++++--- cdd/__init__.py | 2 +- cdd/tests/test_shared/test_pkg_utils.py | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c22be456..c4e3e247 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -121,9 +121,13 @@ jobs: if: (matrix.python-version == '3.8' || matrix.python-version == '3.12') && matrix.os.name == 'Linux' && github.ref == 'refs/heads/master' - name: PyPi release run: | - python -m pip install twine - python setup.py sdist bdist_wheel - python -m twine upload --repository pypi dist/* + if ! git diff --exit-code -s HEAD~1 -- cdd/tests && git diff --exit-code -s HEAD~1 -- ':!cdd/tests' ; then + echo '[warn] Only test(s) changed so not releasing to PyPi' + else + python -m pip install twine + python setup.py sdist bdist_wheel + python -m twine upload --repository pypi dist/* + fi env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} diff --git a/cdd/__init__.py b/cdd/__init__.py index 5c95f9dc..09c3423a 100644 --- a/cdd/__init__.py +++ b/cdd/__init__.py @@ -9,7 +9,7 @@ from logging import getLogger as get_logger __author__ = "Samuel Marks" # type: str -__version__ = "0.0.99rc41" # type: str +__version__ = "0.0.99rc42" # type: str __description__ = ( "Open API to/fro routes, models, and tests. " "Convert between docstrings, classes, methods, argparse, pydantic, and SQLalchemy." diff --git a/cdd/tests/test_shared/test_pkg_utils.py b/cdd/tests/test_shared/test_pkg_utils.py index 68780637..dfdb81ad 100644 --- a/cdd/tests/test_shared/test_pkg_utils.py +++ b/cdd/tests/test_shared/test_pkg_utils.py @@ -7,6 +7,7 @@ from unittest import TestCase from cdd.shared.pkg_utils import get_python_lib, relative_filename +from cdd.shared.pure_utils import rpartial from cdd.tests.utils_for_tests import unittest_main @@ -24,7 +25,7 @@ def test_get_python_lib(self) -> None: site_packages: str = getsitepackages()[0] site_packages: str = next( filter( - partial(eq, python_lib), + rpartial(eq, python_lib), ( lambda two_dir_above: ( site_packages,