From d62ce5b0c24ae3386b75837ecbd1748e5e96278d Mon Sep 17 00:00:00 2001 From: Francis Billa <35119757+FrancisBilla@users.noreply.github.com> Date: Sat, 6 Apr 2024 09:16:53 +0000 Subject: [PATCH 1/5] Create python-publish.yml --- .github/workflows/python-publish.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 000000000..bdaab28a4 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,39 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From 27ced9fcaab7fbfd1eb81abddb74128a7f9c68af Mon Sep 17 00:00:00 2001 From: francis billa Date: Sat, 6 Apr 2024 15:06:19 +0300 Subject: [PATCH 2/5] Migrate to Github Actions #707 --- .github/workflows/build-pipeline.yml | 45 ++++++++++++++++++++++++++++ .github/workflows/python-publish.yml | 39 ------------------------ .travis.yml | 25 ---------------- tox.ini | 25 ---------------- 4 files changed, 45 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/build-pipeline.yml delete mode 100644 .github/workflows/python-publish.yml delete mode 100644 .travis.yml delete mode 100644 tox.ini diff --git a/.github/workflows/build-pipeline.yml b/.github/workflows/build-pipeline.yml new file mode 100644 index 000000000..a75f9f02e --- /dev/null +++ b/.github/workflows/build-pipeline.yml @@ -0,0 +1,45 @@ +# GitHub CI build pipeline +name: Cookie Cutter CI build + +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v3 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install coverage + if [ -f requirements.txt ]; then pip install -r requirements_dev.txt; fi + + - name: Run Tests and generate coverage report + run: | + coverage run -m pytest + - name: Archive code coverage html report + uses: actions/upload-artifact@v2 + with: + name: code-coverage-report + path: src/htmlcov + - name: Run package creation + run: | + python -m pip install --user --upgrade build + python -m build + - name: Archive package + uses: actions/upload-artifact@v2 + with: + name: cookie-cutter + path: src/dist diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index bdaab28a4..000000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Upload Python Package - -on: - release: - types: [published] - -permissions: - contents: read - -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: python -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 15777bdbb..000000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Config file for automatic testing at travis-ci.org - -language: python -python: - - 3.8 - - 3.7 - - 3.6 - -# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors -install: pip install -U tox-travis - -# command to run tests, e.g. python setup.py test -script: tox - -# deploy new versions to PyPI -deploy: - provider: pypi - distributions: sdist bdist_wheel - user: audreyr - password: - secure: PLEASE_REPLACE_ME - on: - tags: true - repo: audreyr/python_boilerplate - python: 3.8 diff --git a/tox.ini b/tox.ini deleted file mode 100644 index b2949261b..000000000 --- a/tox.ini +++ /dev/null @@ -1,25 +0,0 @@ -[tox] -envlist = py36, py37,py38 pypy, docs -skipsdist = true - -[travis] -python = - 3.8: py38 - 3.7: py37 - 3.6: py36 - -[testenv:docs] -basepython=python -changedir=docs -deps=sphinx -commands= - sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html - -[testenv] -setenv = - PYTHONPATH = {toxinidir} -deps = - -r{toxinidir}/requirements_dev.txt -commands = - python -m pip install --upgrade pip - pytest From cfda64a6bb9e1d2e148acf65795530354e02dba5 Mon Sep 17 00:00:00 2001 From: francis billa Date: Sat, 6 Apr 2024 15:09:25 +0300 Subject: [PATCH 3/5] Migrate to Github Actions #707 --- .github/workflows/build-pipeline.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-pipeline.yml b/.github/workflows/build-pipeline.yml index a75f9f02e..ccd62e456 100644 --- a/.github/workflows/build-pipeline.yml +++ b/.github/workflows/build-pipeline.yml @@ -19,13 +19,11 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.x" - - name: Install dependencies run: | python -m pip install --upgrade pip pip install coverage if [ -f requirements.txt ]; then pip install -r requirements_dev.txt; fi - - name: Run Tests and generate coverage report run: | coverage run -m pytest From bc7d1b7a5998ca3e3671151e8e158f3a84f6a1e8 Mon Sep 17 00:00:00 2001 From: francis billa Date: Sat, 6 Apr 2024 15:34:11 +0300 Subject: [PATCH 4/5] Migrate to Github Actions #707 --- .github/workflows/build-pipeline.yml | 11 ++---- appveyor.yml | 51 ---------------------------- 2 files changed, 3 insertions(+), 59 deletions(-) delete mode 100644 appveyor.yml diff --git a/.github/workflows/build-pipeline.yml b/.github/workflows/build-pipeline.yml index ccd62e456..ee495f723 100644 --- a/.github/workflows/build-pipeline.yml +++ b/.github/workflows/build-pipeline.yml @@ -23,15 +23,10 @@ jobs: run: | python -m pip install --upgrade pip pip install coverage - if [ -f requirements.txt ]; then pip install -r requirements_dev.txt; fi - - name: Run Tests and generate coverage report + if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; else pip install . fi + - name: Run Tests run: | - coverage run -m pytest - - name: Archive code coverage html report - uses: actions/upload-artifact@v2 - with: - name: code-coverage-report - path: src/htmlcov + pytest tests/ - name: Run package creation run: | python -m pip install --user --upgrade build diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 9e3d5f7e5..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,51 +0,0 @@ -# What Python version is installed where: -# http://www.appveyor.com/docs/installed-software#python - -environment: - matrix: - - PYTHON: "C:\\Python35" - TOX_ENV: "py35" - - - PYTHON: "C:\\Python35-x64" - TOX_ENV: "py35" - - - PYTHON: "C:\\Python36" - TOX_ENV: "py36" - - - PYTHON: "C:\\Python36-x64" - TOX_ENV: "py36" - - - PYTHON: "C:\\Python37" - TOX_ENV: "py37" - - - PYTHON: "C:\\Python37-x64" - TOX_ENV: "py37" - - - PYTHON: "C:\\Python38" - TOX_ENV: "py38" - - - PYTHON: "C:\\Python38-x64" - TOX_ENV: "py38" - -init: - - set PATH=%PYTHON%;%PYTHON%\Scripts;C:\MinGW\msys\1.0\bin;%PATH% - - "git config --system http.sslcainfo \"C:\\Program Files\\Git\\mingw64\\ssl\\certs\\ca-bundle.crt\"" - - "%PYTHON%/python -V" - - "%PYTHON%/python -c \"import struct;print(8 * struct.calcsize(\'P\'))\"" - -install: - - "%PYTHON%/Scripts/easy_install -U pip" - - "%PYTHON%/Scripts/pip install -U tox virtualenv" - - "%PYTHON%/Scripts/pip install wheel" - -build: false # Not a C# project, build stuff at the test step instead. - -test_script: - - "%PYTHON%/Scripts/tox -e %TOX_ENV%" - -after_test: - - "%PYTHON%/python setup.py --command-packages wheel bdist_wheel" - - ps: "ls dist" - -artifacts: - - path: dist\* From 4ca3d5b796d60bbf015827225350cf1390ea96d8 Mon Sep 17 00:00:00 2001 From: "Audrey M. Roy Greenfeld" Date: Sat, 6 Apr 2024 16:24:55 +0300 Subject: [PATCH 5/5] Update .github/workflows/build-pipeline.yml --- .github/workflows/build-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-pipeline.yml b/.github/workflows/build-pipeline.yml index ee495f723..5cb9a225e 100644 --- a/.github/workflows/build-pipeline.yml +++ b/.github/workflows/build-pipeline.yml @@ -1,5 +1,5 @@ # GitHub CI build pipeline -name: Cookie Cutter CI build +name: Cookiecutter PyPackage CI build on: push: