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

Commit d94a920

Browse files
authored
Merge pull request #8 from epics-containers/dev
merge skeleton features
2 parents 8fc2f78 + 33f4e39 commit d94a920

File tree

12 files changed

+55
-32
lines changed

12 files changed

+55
-32
lines changed

.github/workflows/code.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,16 @@ name: Code CI
22

33
on:
44
push:
5-
branches:
6-
# Restricting to these branches and tags stops duplicate jobs on internal
7-
# PRs but stops CI running on internal branches without a PR. Delete the
8-
# next 5 lines to restore the original behaviour
9-
- master
10-
- main
11-
tags:
12-
- "*"
135
pull_request:
146
schedule:
157
# Run every Monday at 8am to check latest versions of dependencies
168
- cron: "0 8 * * MON"
179

1810
jobs:
1911
lint:
12+
# pull requests are a duplicate of a branch push if they are from within the
13+
# same repo. Skip these
14+
if: github.event_name != 'pull_request' || github.event.pull_request.repository == github.repository
2015
runs-on: "ubuntu-latest"
2116
steps:
2217
- name: Checkout
@@ -28,6 +23,7 @@ jobs:
2823
tox -e pre-commit,mypy
2924
3025
wheel:
26+
if: github.event_name != 'pull_request' || github.event.pull_request.repository == github.repository
3127
strategy:
3228
fail-fast: false
3329
matrix:
@@ -59,6 +55,7 @@ jobs:
5955
run: pipx run --python $(which python${{ matrix.python }}) --spec dist/*.whl python3-pip-skeleton --version
6056

6157
test:
58+
if: github.event_name != 'pull_request' || github.event.pull_request.repository == github.repository
6259
strategy:
6360
fail-fast: false
6461
matrix:
@@ -98,17 +95,16 @@ jobs:
9895
- name: Install with locked dependencies
9996
if: matrix.lock
10097
run: |
101-
echo '# runtime dependencies' > requirements.txt
102-
echo '# developer dependencies' > requirements_dev.txt
103-
# above avoids zero length requirements files
98+
touch requirements.txt
99+
touch requirements_dev.txt
104100
pip install -r requirements.txt -e .
105101
pip freeze --exclude-editable >> requirements.txt
106102
pip install -r requirements_dev.txt -e .[dev]
107103
pip freeze --exclude-editable >> requirements_dev.txt
108104
109105
- name: Install with latest dependencies
110106
if: ${{ ! matrix.lock }}
111-
run: pip install -e .[dev]
107+
run: pip install .[dev]
112108

113109
- name: Run tests
114110
run: pytest tests

.github/workflows/docs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: Docs CI
22

33
on:
44
push:
5-
branches:
6-
# Add more branches here to publish docs from other branches
7-
- master
8-
- main
95
tags:
106
- "*"
117
pull_request:

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ It integrates the following tools:
2626
- which verifies all the things that CI does
2727
- If you use VSCode, it will run black, flake8, isort and mypy on save
2828

29-
The the related ``skeleton`` repo skeleton_ for this module contains the source
29+
The the related skeleton_ repo for this module contains the source
3030
code that can be merged into new or existing projects, and pulled from to
3131
keep them up to date. It can also serve as a working example for those who
3232
would prefer to cherry-pick.
3333

3434
.. _skeleton: https://github.com/epics-containers/python3-pip-skeleton
3535

36-
This ``cli`` repo contains the
36+
This ``python3-pip-skeleton-cli`` repo contains the
3737
docs and a command line tool to ease the adoption of this skeleton into a
3838
new project like this::
3939

40-
python3-pip-skeleton new /path/to/be/created
40+
python3-pip-skeleton new /path/to/be/created --org my_github_user_or_org
4141

4242
and existing projects::
4343

44-
python3-pip-skeleton existing /path/to/existing/repo
44+
python3-pip-skeleton existing /path/to/existing/repo --org my_github_user_or_org
4545

4646
.. |code_ci| image:: https://github.com/epics-containers/python3-pip-skeleton/workflows/Code%20CI/badge.svg?branch=main
4747
:target: https://github.com/epics-containers/python3-pip-skeleton/actions?query=workflow%3A%22Code+CI%22

docs/explanations.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ Explanation of how the library works and why it works that way.
1111
explanations/why-use-skeleton
1212
explanations/why-src
1313
explanations/why-pre-commit
14+
explanations/features

docs/explanations/features.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Feature Update History
2+
======================
3+
4+
August 18th 2022
5+
----------------
6+
7+
.. _CLI: https://epics-containers.github.io/python3-pip-skeleton-cli/
8+
.. _skeleton: https://epics-containers.github.io/python3-pip-skeleton/
9+
10+
- Project split into 2 repos
11+
12+
- this project CLI_ provides this documentation and the code for adopting
13+
skeleton
14+
- the skeleton_ project provides the template source for adoption
15+
- this avoids the confusion of using two 'main' branches in a single repo
16+
- it also allows for separate github settings for the CLI and skeleton as
17+
follows:
18+
19+
- TODO list github branch and PR settings
20+
21+
- Now allow CI to run on all branches but avoid duplicate CI runs using
22+
https://github.com/marketplace/actions/skip-duplicate-actions
23+
- Now use non-editable pip install for tests that do not use requirements.txt
24+
25+
- This verifies that the packaging is working
26+
27+
- the --org option when adopting is now mandatory to avoid accidentally
28+
creating a repo for the default org.
29+
- moved 'contributing.rst' from reference to how-to meaning that we no
30+
longer require a dummy how-to article
31+
- removed example code hello.py meaning that this does not
32+
have to be deleted after adopting. Also removed related tests.
33+
- Skeleton README reduced to remove example code and to point at
34+
skeleton-cli for instructions.

docs/how-to.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ Practical step-by-step guides for the more experienced user.
1111
how-to/existing
1212
how-to/update
1313
how-to/excalidraw
14+
how-to/contributing
File renamed without changes.

docs/reference.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Practical step-by-step guides for the more experienced user.
88
.. toctree::
99
:caption: Reference
1010

11-
reference/contributing
1211
Releases <https://github.com/epics-containers/python3-pip-skeleton/releases>
1312
Index <genindex.html#http://>
1413

docs/tutorials/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Installation
44
.. note::
55

66
If you want to contribute to the library itself, please follow
7-
the `../reference/contributing` instructions.
7+
the `../how-to/contributing` instructions.
88

99

1010
Check your version of python

docs/tutorials/new.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Creating a new repo from the skeleton
44
Once you have followed the `installation` tutorial, you can use the
55
commandline tool to make a new repo that inherits the skeleton::
66

7-
python3-pip-skeleton new /path/to/be/created
7+
python3-pip-skeleton new /path/to/be/created --org my_github_user_or_org
88

99
This will:
1010

@@ -49,9 +49,6 @@ run this, there will be some failing tests::
4949
FAILED tests/test_boilerplate_removed.py::test_changed_README_body - AssertionError: Please change ./README.rst to include some features and why people should use it
5050
FAILED tests/test_boilerplate_removed.py::test_removed_CHANGELOG_note - AssertionError: Please change ./CHANGELOG.rst To remove the note at the top
5151
FAILED tests/test_boilerplate_removed.py::test_changed_CHANGELOG - AssertionError: Please change ./CHANGELOG.rst To summarize changes to your module as you make them
52-
FAILED tests/test_boilerplate_removed.py::test_docs_ref_api_changed - AssertionError: Please change ./docs/reference/api.rst to introduce the API for your module
53-
FAILED tests/test_boilerplate_removed.py::test_how_tos_written - AssertionError: Please delete ./docs/how-to/accomplish-a-task.rst and write some docs/how-tos
54-
FAILED tests/test_boilerplate_removed.py::test_explanations_written - AssertionError: Please delete ./docs/explanations/why-is-something-so.rst and write some docs/explanations
5552
========================================================================== 8 failed, 5 passed in 0.28s ==========================================================================
5653

5754
When you change the template text mentioned in the error, these tests will pass.

0 commit comments

Comments
 (0)