Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit 15fd2f4

Browse files
committed
Updates from code review.
updates from review system python for lint better release files final review changes add test of runtime container
1 parent 73ad00d commit 15fd2f4

23 files changed

+96
-80
lines changed

.containerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist/
44
.mypy_cache
55
.tox
66
.venv*
7+
venv*

.devcontainer.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
// Set *default* container specific settings.json values on container create.
1414
"settings": {
15-
"python.defaultInterpreterPath": "/usr/local/bin/python",
15+
"python.defaultInterpreterPath": "/venv/bin/python",
1616
"python.linting.enabled": true
1717
},
1818
// Add the IDs of extensions you want installed when the container is created.
@@ -21,12 +21,10 @@
2121
"ms-python.vscode-pylance"
2222
],
2323
// Make sure the files we are mapping into the container exist on the host
24-
"initializeCommand": "bash -c 'for i in $HOME/.inputrc $HOME/.bashrc_dev; do [ -f $i ] || touch $i; done'",
24+
"initializeCommand": "bash -c 'for i in $HOME/.inputrc; do [ -f $i ] || touch $i; done'",
2525
"runArgs": [
26-
"--privileged",
2726
"--net=host",
2827
"-v=${localEnv:HOME}/.ssh:/root/.ssh",
29-
"-v=${localEnv:HOME}/.bashrc_dev:/root/.bashrc",
3028
"-v=${localEnv:HOME}/.inputrc:/root/.inputrc"
3129
],
3230
"mounts": [

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/code.yml

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
schedule:
77
# Run every Monday at 8am to check latest versions of dependencies
8-
- cron: "0 8 * * MON"
8+
- cron: "0 8 * * WED"
99

1010
jobs:
1111
lint:
@@ -17,15 +17,15 @@ jobs:
1717
- name: Checkout
1818
uses: actions/checkout@v2
1919

20-
- uses: actions/setup-python@v4
20+
- name: Setup python
21+
uses: actions/setup-python@v4
2122
with:
2223
python-version: "3.10"
2324

2425
- name: Lint
2526
run: |
26-
touch requirements_dev.txt
27-
python -m pip install --upgrade pip
28-
python -m pip install -r requirements_dev.txt -e .[dev]
27+
touch requirements_dev.txt requirements.txt
28+
pip install -r requirements.txt -r requirements_dev.txt -e .[dev]
2929
tox -e pre-commit,mypy
3030
3131
test:
@@ -59,7 +59,7 @@ jobs:
5959
run: pytest tests
6060

6161
- name: Upload coverage to Codecov
62-
uses: codecov/codecov-action@v2
62+
uses: codecov/codecov-action@v3
6363
with:
6464
name: ${{ matrix.python }}/${{ matrix.os }}
6565
files: cov.xml
@@ -77,14 +77,6 @@ jobs:
7777
with:
7878
fetch-depth: 0
7979

80-
- name: Cache Docker layers
81-
uses: actions/cache@v3
82-
with:
83-
path: /tmp/.buildx-cache
84-
key: ${{ runner.os }}-buildx-${{ github.sha }}
85-
restore-keys: |
86-
${{ runner.os }}-buildx-
87-
8880
- name: Log in to GitHub Docker Registry
8981
if: github.event_name != 'pull_request'
9082
uses: docker/login-action@v2
@@ -112,16 +104,21 @@ jobs:
112104
tags: build:latest
113105
context: .
114106
target: build
115-
cache-from: type=local,src=/tmp/.buildx-cache
116-
cache-to: type=local,dest=/tmp/.buildx-cache
117107
load: true
118108

119109
- name: Run tests in the container locked with requirements_dev.txt
120110
run: |
121-
docker run --name test build bash /project/tests/container_tests.sh
111+
docker run --name test build bash /project/.github/workflows/container_tests.sh
122112
docker cp test:/project/dist .
123113
docker cp test:/project/requirements.txt .
124114
docker cp test:/project/requirements_dev.txt .
115+
docker cp test:/project/cov.xml .
116+
117+
- name: Upload coverage to Codecov
118+
uses: codecov/codecov-action@v3
119+
with:
120+
name: 3.10-locked/ubuntu-latest
121+
files: cov.xml
125122

126123
- name: Build runtime image
127124
uses: docker/build-push-action@v3
@@ -130,8 +127,9 @@ jobs:
130127
tags: ${{ steps.meta.outputs.tags }}
131128
context: .
132129
labels: ${{ steps.meta.outputs.labels }}
133-
cache-from: type=local,src=/tmp/.buildx-cache
134-
cache-to: type=local,dest=/tmp/.buildx-cache
130+
131+
- name: Check runtime
132+
run: for i in ${{ steps.meta.outputs.tags }}; do docker run ${i} --version; done
135133

136134
- name: Upload build files
137135
uses: actions/upload-artifact@v3
@@ -147,27 +145,19 @@ jobs:
147145
runs-on: ubuntu-latest
148146

149147
steps:
150-
- name: Checkout
151-
uses: actions/checkout@v2
152-
153-
- uses: actions/setup-python@v4
154-
with:
155-
python-version: "3.10"
156-
157148
- uses: actions/download-artifact@v3
158149

159150
- name: Install sdist in a venv and check cli works
160151
# ${GITHUB_REPOSITORY##*/} is the repo name without org
161152
# Replace this with the cli command if different to the repo name
162153
run: |
163-
python -m pip install --upgrade pip
164-
python -m pip install build_files/dist/*.gz
154+
pip install build_files/dist/*.gz
165155
${GITHUB_REPOSITORY##*/} --version
166156
167157
release:
168158
# upload to PyPI and make a release on every tag
169159
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
170-
needs: [lint, container]
160+
needs: container
171161
runs-on: ubuntu-latest
172162

173163
steps:
@@ -180,6 +170,7 @@ jobs:
180170
with:
181171
files: |
182172
build_files/*
173+
build_files/dist/*
183174
generate_release_notes: true
184175
env:
185176
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -188,4 +179,4 @@ jobs:
188179
env:
189180
TWINE_USERNAME: __token__
190181
TWINE_PASSWORD: ${{ secrets.pypi_token }}
191-
run: pipx run twine upload artifacts/dist/*
182+
run: pipx run twine upload build_files/dist/*

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: tox -e docs
4545

4646
- name: Move to versioned directory
47-
# e.g. master or 0.1.2
47+
# e.g. main or 0.1.2
4848
run: mv build/html ".github/pages/${GITHUB_REF##*/}"
4949

5050
- name: Write versions.txt

.github/workflows/linkcheck.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Link Check
33
on:
44
schedule:
55
# Run every Monday at 8am to check URL links still resolve
6-
- cron: "0 8 * * MON"
6+
- cron: "0 8 * * WED"
77

88
jobs:
99
docs:
@@ -16,10 +16,6 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- name: Avoid git conflicts when tag and branch pushed at same time
20-
if: startsWith(github.ref, 'refs/tags')
21-
run: sleep 60
22-
2319
- name: Checkout
2420
uses: actions/checkout@v2
2521
with:

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ docs/_build/
6060
# PyBuilder
6161
target/
6262

63-
# DLS build dir and virtual environment
64-
/prefix/
65-
/venv/
66-
/lightweight-venv/
67-
/installed.files
63+
# likely venv names
6864
.venv*
65+
venv*
66+
6967

.gitremotes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"tasks": [
66
{
77
"type": "shell",
8-
"label": "Tests with coverage",
9-
"command": "tox -e pytest",
8+
"label": "Tests, lint and docs",
9+
"command": "tox -p",
1010
"options": {
1111
"cwd": "${workspaceRoot}"
1212
},

0 commit comments

Comments
 (0)