Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
boromir674 committed Oct 22, 2023
1 parent 445ccc3 commit 38e66ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
shell: bash
id: parse_version
run: |
PARSER="src/cookiecutter_python/{{ cookiecutter.project_slug }}/scripts/parse_version.py"
PARSER="scripts/parse_version.py"
PARSED_VERSION=$(python "${PARSER}")
# transform version (ie 1.7.4-rc.1) to match the name of the wheel produced (ie 1.7.4rc1)
WHEEL_VERSION=$(echo $PARSED_VERSION | sed -E 's/([^.]*)\.([^.]*)\.([^-]*)-(rc)\.?(.*)/\1.\2.\3\4\5/')
Expand Down Expand Up @@ -127,8 +127,8 @@ jobs:
# DIST_DIR=dist
# echo "DIST_DIR=dist" >> $GITHUB_ENV
# mkdir ${DIST_DIR}
# mv ".tox/${DIST_DIR}/cookiecutter_python-${PKG_VERSION}.tar.gz" "${DIST_DIR}"
# mv ".tox/${DIST_DIR}/cookiecutter_python-${PKG_VERSION}-py3-none-any.whl" "${DIST_DIR}"
# mv ".tox/${DIST_DIR}/artificial_artwork-${PKG_VERSION}.tar.gz" "${DIST_DIR}"
# mv ".tox/${DIST_DIR}/artificial_artwork-${PKG_VERSION}-py3-none-any.whl" "${DIST_DIR}"
# tox -e check -vv -s false
# - name: Install documentation test dependencies
# if: ${{ matrix.platform == 'macos-latest' && matrix.python-version != '3.6' }}
Expand Down Expand Up @@ -178,8 +178,8 @@ jobs:
run: |
# workflow enabled for branches and v* tags
IMAGE_TAG="${GITHUB_REF_NAME}" # this is branch name or tag name
echo "IMAGE_REF=generate-python:${IMAGE_TAG}" >> $GITHUB_ENV
docker build -t "${DOCKER_USER}/generate-python:${IMAGE_TAG}" .
echo "IMAGE_REF=neural-style-transfer:${IMAGE_TAG}" >> $GITHUB_ENV
docker build -t "${DOCKER_USER}/neural-style-transfer:${IMAGE_TAG}" .
- name: Publish Docker Image to DockerHub
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:
run: |
TAG="${GITHUB_REF_NAME}"
SEM_VER="${TAG:1}" # remove the first character (v)
PARSER="src/cookiecutter_python/{{ cookiecutter.project_slug }}/scripts/parse_version.py"
PARSER="scripts/parse_version.py"
PARSED_VERSION=$(python "${PARSER}")
if [[ "${PARSED_VERSION}" != "${SEM_VER}" ]]; then
echo "ERROR: Version in __init__.py (${PARSED_VERSION}) does not match tag (${SEM_VER})"
Expand All @@ -260,7 +260,7 @@ jobs:
- run: mkdir ${DIST_DIR}
- run: |
# Get Source Distribution (tar.gz of source code)
source_distributions=$(find downloaded-artifacts -type f -name cookiecutter_python*.tar.gz)
source_distributions=$(find downloaded-artifacts -type f -name artificial_artwork*.tar.gz)
source_distributions_array=($source_distributions)
source_distribution=${source_distributions_array[0]} # a *.tar.gz file path
# Extract the base name (without the path)
Expand All @@ -276,7 +276,7 @@ jobs:
- run: cp "$source_distribution" ${DIST_DIR}
- run: |
# Get all built Wheels and copy to dist folder
for f in `find downloaded-artifacts -type f -name cookiecutter_python*.whl`; do
for f in `find downloaded-artifacts -type f -name artificial_artwork*.whl`; do
echo "F: $f";
# TODO check for duplicates, which means that our build matrix produces the same wheel (need a different compiler that python such as pypy, cython, etc)
cp $f ${DIST_DIR}
Expand Down Expand Up @@ -385,7 +385,7 @@ jobs:
sudo apt-get update -y --allow-releaseinfo-change
sudo apt-get install -y graphviz
- name: Draw Dependency Graphs as .svg files
run: tox -e pydeps -vv -s false
run: TOXPYTHON=python tox -e pydeps -vv -s false
- name: Upload Dependency Graphs as artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ setenv =
MYPYPATH = {toxinidir}{/}src{/}stubs
black,lint,isort: LINT_ARGS = "src tests scripts"
# PYTHONPATH = {toxinidir}{/}tests
extras =
test
commands =
# --cov-config pyproject.toml
pytest -ra --cov --cov-report=term-missing \
Expand All @@ -34,6 +32,7 @@ commands =
[testenv:dev]
description = Using `python3` in PATH: Install in 'edit' mode & Test
basepython = {env:TOXPYTHON:python3}
extras = test
usedevelop = true
commands = pytest {toxinidir}{/}tests \
-ra -vvs {posargs}
Expand All @@ -43,6 +42,7 @@ commands = pytest {toxinidir}{/}tests \
[testenv:dev-cov]
description = Using `python3` in PATH: Install in 'edit' mode, Test & measure Coverage
basepython = {env:TOXPYTHON:python3}
extras = test
usedevelop = true
commands =
pytest -ra --cov --cov-report=term-missing \
Expand All @@ -69,6 +69,7 @@ commands = nst {posargs:--iterations 600 --location nst_output}
[testenv:test38]
basepython = {env:TOXPYTHON:python3.8}
deps = pytest
extras = test
use_develop = false
commands = pytest {posargs} -vv

Expand Down

0 comments on commit 38e66ba

Please sign in to comment.