Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .containerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist/
.mypy_cache
.tox
.venv*
venv*
6 changes: 2 additions & 4 deletions .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.defaultInterpreterPath": "/venv/bin/python",
"python.linting.enabled": true
},
// Add the IDs of extensions you want installed when the container is created.
Expand All @@ -21,12 +21,10 @@
"ms-python.vscode-pylance"
],
// Make sure the files we are mapping into the container exist on the host
"initializeCommand": "bash -c 'for i in $HOME/.inputrc $HOME/.bashrc_dev; do [ -f $i ] || touch $i; done'",
"initializeCommand": "bash -c 'for i in $HOME/.inputrc; do [ -f $i ] || touch $i; done'",
"runArgs": [
"--privileged",
"--net=host",
"-v=${localEnv:HOME}/.ssh:/root/.ssh",
"-v=${localEnv:HOME}/.bashrc_dev:/root/.bashrc",
"-v=${localEnv:HOME}/.inputrc:/root/.inputrc"
],
"mounts": [
Expand Down
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

46 changes: 17 additions & 29 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
schedule:
# Run every Monday at 8am to check latest versions of dependencies
- cron: "0 8 * * MON"
- cron: "0 8 * * WED"

jobs:
lint:
Expand All @@ -17,15 +17,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: actions/setup-python@v2
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Lint
run: |
touch requirements_dev.txt
python -m pip install --upgrade pip
python -m pip install -r requirements_dev.txt -e .[dev]
touch requirements_dev.txt requirements.txt
pip install -r requirements.txt -r requirements_dev.txt -e .[dev]
tox -e pre-commit,mypy

test:
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
run: pytest tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
name: ${{ matrix.python }}/${{ matrix.os }}
files: cov.xml
Expand All @@ -82,14 +82,6 @@ jobs:
with:
fetch-depth: 0

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Log in to GitHub Docker Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
Expand Down Expand Up @@ -117,16 +109,21 @@ jobs:
tags: build:latest
context: .
target: build
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
load: true

- name: Run tests in the container locked with requirements_dev.txt
run: |
docker run --name test build bash /project/tests/container_tests.sh
docker run --name test build bash /project/.github/workflows/container_tests.sh
docker cp test:/project/dist .
docker cp test:/project/requirements.txt .
docker cp test:/project/requirements_dev.txt .
docker cp test:/project/cov.xml .

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: 3.10-locked/ubuntu-latest
files: cov.xml

- name: Build runtime image
uses: docker/build-push-action@v3
Expand All @@ -135,8 +132,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
context: .
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Upload build files
uses: actions/upload-artifact@v3
Expand All @@ -152,28 +147,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.10"

- uses: actions/download-artifact@v3

- name: Install sdist in a venv and check cli works
# ${GITHUB_REPOSITORY##*/} is the repo name without org
# Replace this with the cli command if different to the repo name
# (In the python3-pip-skeleton-cli this is already renamed)
run: |
python -m pip install --upgrade pip
python -m pip install build_files/dist/*.gz
pip install build_files/dist/*.gz
python3-pip-skeleton --version

release:
# upload to PyPI and make a release on every tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [lint, container]
needs: container
runs-on: ubuntu-latest

steps:
Expand All @@ -186,6 +173,7 @@ jobs:
with:
files: |
build_files/*
build_files/dist/*
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: tox -e docs

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

- name: Write versions.txt
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Link Check
on:
schedule:
# Run every Monday at 8am to check URL links still resolve
- cron: "0 8 * * MON"
- cron: "0 8 * * WED"

jobs:
docs:
Expand All @@ -16,10 +16,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Avoid git conflicts when tag and branch pushed at same time
if: startsWith(github.ref, 'refs/tags')
run: sleep 60

- name: Checkout
uses: actions/checkout@v2
with:
Expand Down
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ docs/_build/
# PyBuilder
target/

# DLS build dir and virtual environment
/prefix/
/venv/
/lightweight-venv/
/installed.files
# likely venv names
.venv*
venv*


1 change: 0 additions & 1 deletion .gitremotes

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"recommendations": [
"ms-vscode-remote.remote-containers"
"ms-python.vscode-pylance",
"ms-python.python",
"ryanluker.vscode-coverage-gutters"
]
}
}
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"tasks": [
{
"type": "shell",
"label": "Tests with coverage",
"command": "tox -e pytest",
"label": "Tests, lint and docs",
"command": "tox -p",
"options": {
"cwd": "${workspaceRoot}"
},
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The code in this repository conforms to standards set by the following tools:
- isort_ for import ordering
- mypy_ for static type checking

flake8 and black be run by pre-commit_. You can run the above checks on
flake8 and black and isort are run by pre-commit_. You can run the above checks on
all files with this command::

$ tox -e pre-commit,mypy
Expand Down Expand Up @@ -140,7 +140,7 @@ Release Process
Releases are only made when the commandline tool needs to be released.
When this happens:

- Choose a new PEP440 compliant release number
- Choose a new PEP440 compliant release number (see https://peps.python.org/pep-0440/)
- Go to the GitHub release_ page
- Choose ``Draft New Release``
- Click ``Choose Tag`` and supply the new tag you chose (click create new tag)
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ RUN cd /project && \
pip install --upgrade pip && \
pip install -r requirements.txt dist/*.whl && \
pip freeze > requirements.txt && \
# we don't want to include our own wheel in requirements - remove with sed
sed -i '/file:\/\//d' requirements.txt

FROM python:3.10-slim as runtime
Expand Down
1 change: 1 addition & 0 deletions docs/explanations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Explanation of how the library works and why it works that way.
explanations/why-src
explanations/why-pre-commit
explanations/features
explanations/decisions
17 changes: 17 additions & 0 deletions docs/explanations/decisions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, You can obtain one at http://mozilla.org/MPL/2.0/.

Architectural Decision Records
==============================

We record major architectural decisions in Architecture Decision Records (ADRs),
as `described by Michael Nygard
<http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions>`_.
Below is the list of our current ADRs.

.. toctree::
:maxdepth: 1
:glob:

decisions/*
26 changes: 26 additions & 0 deletions docs/explanations/decisions/0001-record-architecture-decisions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
1. Record architecture decisions
================================

Date: 2022-02-18

Status
------

Accepted

Context
-------

We need to record the architectural decisions made on this project.

Decision
--------

We will use Architecture Decision Records, as `described by Michael Nygard
<http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions>`_.

Consequences
------------

See Michael Nygard's article, linked above. To create new ADRs we will copy and
paste from existing ones.
2 changes: 1 addition & 1 deletion docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Reference
=========

Practical step-by-step guides for the more experienced user.
Technical reference material including APIs and release notes.

.. toctree::
:caption: Reference
Expand Down
9 changes: 8 additions & 1 deletion docs/tutorials/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installation
Check your version of python
----------------------------

You will need python 3.7 or later. You can check your version of python by
You will need python 3.8 or later. You can check your version of python by
typing into a terminal::

python3 --version
Expand Down Expand Up @@ -36,3 +36,10 @@ The library should now be installed and the commandline interface on your path.
You can check the version that has been installed by typing::

python3-pip-skeleton --version

Running in a container
----------------------

To pull the container from github container registry and run::

docker run ghcr.io/epics-containers/python3-pip-skeleton:main --version
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[build-system]
# To get a reproducible wheel, wheel must be pinned to the same version as in
# dls-python3, and setuptools must produce the same dist-info. Cap setuptools
# to the last version that didn't add License-File to METADATA
requires = ["setuptools<57", "wheel==0.33.1"]
requires = ["setuptools>=64", "setuptools_scm[toml]>=6.2", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ skipinstall=true
passenv =
PYTHONPATH
HOME
setenv =
QT_QPA_PLATFORM = offscreen
allowlist_externals =
pytest
pre-commit
Expand Down
File renamed without changes.