Skip to content

Commit

Permalink
[cdd/tests/test_shared/test_pkg_utils.py] Use rpartial ; [.github/w…
Browse files Browse the repository at this point in the history
…orkflows/main.yml] Only release to PyPi when something other than tests changed ; [cdd/__init__.py] Bump version (last useless bump!)
  • Loading branch information
SamuelMarks committed Mar 16, 2024
1 parent 86c08a4 commit 50d14a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion cdd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
3 changes: 2 additions & 1 deletion cdd/tests/test_shared/test_pkg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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,
Expand Down

0 comments on commit 50d14a9

Please sign in to comment.