Skip to content

Commit

Permalink
release 3.3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanganderson committed Aug 8, 2024
0 parents commit 455b5e8
Show file tree
Hide file tree
Showing 56 changed files with 6,714 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[run]
omit =
**/conftest.py
**trial_numbers.py
branch = True

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
^ \.\.\.$

# Don't complain about print statements not run
print\(.*\)

# Don't complain about platform versions
.call_args.

skip_covered=false
show_missing=true
# fail_under=100
19 changes: 19 additions & 0 deletions .github/ dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
# Maintain Python dependencies.
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"

# Maintain Python production test dependencies.
- package-ecosystem: "pip"
directory: "production-test/"
schedule:
interval: "weekly"

# Maintain dependencies for GitHub Actions.
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
211 changes: 211 additions & 0 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
name: CI-CD

on:
push:
branches:
- release/messaging-v3

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- uses: actions/[email protected]
id: cache-poetry
with:
path: ~/.virtualenvs
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock', 'poetry.toml') }}
- name: Configure poetry for ci
run: |
poetry config virtualenvs.in-project false --local
poetry config virtualenvs.path ~/.virtualenvs --local
- name: Install dependencies
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
poetry update && poetry install --no-root
- name: run tests
env:
VALID_TELSTRA_CLIENT_ID: ${{ secrets.VALID_TELSTRA_CLIENT_ID }}
VALID_TELSTRA_CLIENT_SECRET: ${{ secrets.VALID_TELSTRA_CLIENT_SECRET }}
run: |
poetry run pytest || (poetry install --no-root && poetry run pytest)
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- uses: pre-commit/[email protected]

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install poetry
run: pip install poetry
- uses: actions/[email protected]
id: cache-poetry
with:
path: ~/.virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock', 'poetry.toml') }}
- name: Configure poetry for ci
run: |
poetry config virtualenvs.in-project false --local
poetry config virtualenvs.path ~/.virtualenvs --local
- name: Update lock file
run: |
poetry lock
- name: Install dependencies
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
poetry install
- name: Build packages
run: poetry build
- name: Upload artifacts for release
uses: actions/[email protected]
with:
name: wheel
path: dist/

release-required:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.check.outputs.result }}
project-version: ${{ steps.check.outputs.project-version }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install poetry and package
run: |
pip install --use-deprecated legacy-resolver poetry telstra.messaging
- name: Check if release is required
id: check
run: |
RELEASED_VERSION=$(python -c "from importlib.metadata import version;print(version('telstra.messaging'))")
echo released version: $RELEASED_VERSION
PROJECT_VERSION=$(poetry version -s)
echo project version: $PROJECT_VERSION
[[ "$RELEASED_VERSION" == "$PROJECT_VERSION" ]] && RESULT=false || RESULT=true
echo release required: $RESULT
echo "::set-output name=project-version::$PROJECT_VERSION"
echo "::set-output name=result::$RESULT"
# release-test-pypi:
# runs-on: ubuntu-latest
# needs:
# - test
# - build
# - pre-commit
# - release-required
# steps:
# - name: Retrieve packages
# if: needs.release-required.outputs.result == 'true'
# uses: actions/[email protected]
# with:
# name: wheel
# path: dist/
# - name: Publish distribution 📦 to Test PyPI
# if: needs.release-required.outputs.result == 'true'
# uses: pypa/[email protected]
# with:
# password: ${{ secrets.SECRET_PUBLISH_AS_TELSTRA_TEST_PYPI_ORG }}
# repository_url: https://test.pypi.org/legacy/

# test-production-test-pypi:
# runs-on: ubuntu-latest
# needs:
# - release-test-pypi
# - release-required
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: "3.10"
# - name: install pipenv
# run: |
# python -m pip install --upgrade pip
# pip install pipenv
# - name: install dependencies
# env:
# PYPI_MIRROR: https://test.pypi.org/simple/
# VERSION: ${{ needs.release-required.outputs.project-version }}
# working-directory: production-test
# run: |
# pipenv install --dev || sleep 30 && pipenv install --dev || sleep 30 && pipenv install --dev || sleep 30 && pipenv install --dev
# - name: run tests
# working-directory: production-test
# env:
# TELSTRA_CLIENT_ID: ${{ secrets.PR_TEST_CLIENT_ID_MESSAGING }}
# TELSTRA_CLIENT_SECRET: ${{ secrets.PR_TEST_CLIENT_SECRET_MESSAGING }}
# run: |
# pipenv run test

release-pypi:
runs-on: ubuntu-latest
needs:
# - test-production-test-pypi
- release-required
steps:
- name: Retrieve packages
if: needs.release-required.outputs.result == 'true'
uses: actions/[email protected]
with:
name: wheel
path: dist/
- name: Publish distribution 📦 to PyPI
if: needs.release-required.outputs.result == 'true'
uses: pypa/[email protected]
with:
password: ${{ secrets.SECRET_PUBLISH_AS_TELSTRA_PYPI_ORG }}

# test-production-pypi:
# runs-on: ubuntu-latest
# needs:
# - release-pypi
# - release-required
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: "3.10"
# - name: install pipenv
# run: |
# python -m pip install --upgrade pip
# pip install pipenv
# - name: install dependencies
# env:
# PYPI_MIRROR: https://pypi.org/simple/
# VERSION: ${{ needs.release-required.outputs.project-version }}
# working-directory: production-test
# run: |
# pipenv install --dev || sleep 30 && pipenv install --dev || sleep 30 && pipenv install --dev || sleep 30 && pipenv install --dev
# - name: run tests
# working-directory: production-test
# env:
# TELSTRA_CLIENT_ID: ${{ secrets.PR_TEST_CLIENT_ID_MESSAGING }}
# TELSTRA_CLIENT_SECRET: ${{ secrets.PR_TEST_CLIENT_SECRET_MESSAGING }}
# run: |
# pipenv run test
74 changes: 74 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
.venv
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.python-version

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints

.DS_Store

# Pytest
.pytest_cache
__pycache__

# VSCode
.vscode
Loading

0 comments on commit 455b5e8

Please sign in to comment.