Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
boromir674 committed Dec 9, 2021
2 parents 9c16096 + 50946ad commit 178087e
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 30 deletions.
49 changes: 29 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
name: Upload the code coverage measurements to codecov.io, resulted from running the test suite (unit tests)
command: ./.codecov

deploy-to-staging:
testpypi-install-n-test:
executor: py38-docker-image
steps:
- checkout
Expand All @@ -103,14 +103,24 @@ jobs:
command: tox -e build -vv
- run:
name: Deploy package (source distro & wheel) to 'testpypi' (index) server
command: |
export SOFTWARE_PATTERNS_LIB_VERSION=$(python scripts/parse_package_version.py)
tox -e deploy -vv
command: tox -e deploy -vv

integration-test:
executor: py38-docker-image
steps:
- checkout
- run:
name: Install the package from test.pypi.org
command: pip install --no-deps --index-url https://test.pypi.org/simple/ software-patterns
- run:
name: Install pytest, which is used both in the test suite code and as a test runner
command: pip install pytest
- run:
name: Run the test suite (unit-tests)
command: pytest tests -v

visualize_code:
executor: py38-docker-image
environment:
NST_DEPS_GRAPHS: dependency-graphs
steps:
- checkout
- run: sudo apt-get update -y --allow-releaseinfo-change
Expand Down Expand Up @@ -162,8 +172,7 @@ workflows:
branches:
only:
- master
- dev
- release-staging
- visualize-code

# - build-documentation:
# filters:
Expand All @@ -172,15 +181,15 @@ workflows:
# - master
# - dev
# - release-staging
# - deploy-to-staging:
# requires:
# - build_n_test
# filters:
# branches:
# only: release-staging
# - integration-test:
# requires:
# - deploy-to-staging
# filters:
# branches:
# only: release-staging
- testpypi-install-n-test:
requires:
- build_n_test
filters:
branches:
only: test-pypi
- integration-test:
requires:
- testpypi-install-n-test
filters:
branches:
only: test-pypi
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
0.9.0 (2021-12-09)
------------------

Changes
^^^^^^^

feature
"""""""
- add memoize, notification, proxy & subclass registry software design patterns

ci
""
- define jobs (ie build_n_test) and a workflow to run on CircleCI
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ Install from the Pypi server:
:alt: PyPI - Python Version
:target: https://pypi.org/project/software-patterns

.. |commits_since| image:: https://img.shields.io/github/commits-since/boromir674/software-patterns/v0.6.1/master?color=blue&logo=Github
.. |commits_since| image:: https://img.shields.io/github/commits-since/boromir674/software-patterns/v0.9.0/master?color=blue&logo=Github
:alt: GitHub commits since tagged version (branch)
:target: https://github.com/boromir674/software-patterns/compare/v0.6.1..master
:target: https://github.com/boromir674/software-patterns/compare/v0.9.0..master



Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
## Setuptools specific information
name = software_patterns
version = 0.8.0
version = 0.9.0
description = Software Design Patterns with types in Python.
long_description = file: README.rst
long_description_content_type = text/x-rst
Expand Down Expand Up @@ -92,3 +92,4 @@ ignore =
.pylintrc
.prospector.yml
.DS_Store
CHANGELOG.rst
16 changes: 9 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ setenv =
JUNIT_TEST_RESULTS=junit-test-results.xml

PY_PACKAGE=software_patterns
DIST_DIR=dist-dir
deps =
pytest
pytest-cov
Expand Down Expand Up @@ -76,19 +77,19 @@ commands =


[testenv:build]
description = Create/build the python package/distribution.
Creates .tar.gz and .whl files in the 'dist' folder, that can be upload to a pypi index server.
description = Create a source and wheel distribution.
Creates .tar.gz and .whl files in the 'dist-dir' folder, that can be upload to a pypi index server.
basepython = {env:TOXPYTHON:python3}
deps =
setuptools >= 40.0.0
skip_install = true
commands_pre =
# Delete the 'dist' directory and its contents if found
python -c 'import os; import shutil; exec("if os.path.exists(os.path.join(\"{toxinidir}\", \"dist\")):\n shutil.rmtree(os.path.join(\"{toxinidir}\", \"dist\"))")'
# Delete the 'dist-dir' directory and its contents if found
python -c 'import os; import shutil; exec("if os.path.exists(os.path.join(\"{toxinidir}\", \"{env:DIST_DIR}\")):\n shutil.rmtree(os.path.join(\"{toxinidir}\", \"{env:DIST_DIR}\"))")'
# Create a setup.py file that simply invokes setuptools.setup without arguments (since all metadata required for building using setuptools should be present in non python files pyproject.toml and/or setup.cfg)
python -c 'import os; setup_py = os.path.join("{toxinidir}", "setup.py"); string = "from setuptools import setup\nsetup()"; exec("if not os.path.exists(setup_py):\n with open(setup_py, \"x\") as f:\n f.write(string)")'
commands =
python setup.py sdist bdist_wheel
python setup.py sdist -d dist-dir bdist_wheel -d dist-dir
commands_post =
# Delete the generated setup.py file
python -c 'import os; setup_py = os.path.join("{toxinidir}", "setup.py"); exec("if os.path.exists(setup_py):\n os.remove(setup_py)");'
Expand All @@ -109,9 +110,10 @@ deps =
skip_install = true
commands_pre =
# check whether the distribution’s long description will render correctly on PyPI
twine check dist/software[\-_]patterns-{env:SOFTWARE_PATTERNS_LIB_VERSION:PLEASE_INDICATE_THE_SEM_VER_FOR_RELEASE}*
; twine check {env:DIST_DIR}/software[\-_]patterns-{env:SOFTWARE_PATTERNS_LIB_VERSION:}*
twine check {env:DIST_DIR}/{env:PY_PACKAGE}-{env:SOFTWARE_PATTERNS_LIB_VERSION:}*
commands =
twine {posargs:upload --non-interactive} --repository {env:PYPI_SERVER:testpypi --skip-existing} dist/software[\-_]design-{env:SOFTWARE_PATTERNS_LIB_VERSION:PLEASE_INDICATE_THE_SEM_VER_FOR_RELEASE}* --verbose
twine {posargs:upload --non-interactive} --repository {env:PYPI_SERVER:testpypi --skip-existing} {env:DIST_DIR}/{env:PY_PACKAGE}-{env:SOFTWARE_PATTERNS_LIB_VERSION:}* --verbose


## STATIC ANALYSIS OF CODE
Expand Down

0 comments on commit 178087e

Please sign in to comment.