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

Commit 3b6647b

Browse files
committed
merge skeleton features
2 parents e1b374a + f1c96b0 commit 3b6647b

File tree

9 files changed

+49
-24
lines changed

9 files changed

+49
-24
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:

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

src/python3_pip_skeleton/__main__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,7 @@ def main(args=None):
229229
sub = subparsers.add_parser("new", help="Make a new repo forked from this skeleton")
230230
sub.set_defaults(func=new)
231231
sub.add_argument("path", type=Path, help="Path to new repo to create")
232-
sub.add_argument(
233-
"--org", default="epics-containers", help="GitHub org, default epics-containers"
234-
)
232+
sub.add_argument("--org", required=True, help="GitHub organization for the repo")
235233
sub.add_argument(
236234
"--package", default=None, help="Package name, defaults to directory name"
237235
)
@@ -245,9 +243,7 @@ def main(args=None):
245243
sub = subparsers.add_parser("existing", help="Adopt skeleton in existing repo")
246244
sub.set_defaults(func=existing)
247245
sub.add_argument("path", type=Path, help="Path to new repo to existing repo")
248-
sub.add_argument(
249-
"--org", default="epics-containers", help="GitHub org, default epics-containers"
250-
)
246+
sub.add_argument("--org", required=True, help="GitHub organization for the repo")
251247
sub.add_argument(
252248
"--package", default=None, help="Package name, defaults to directory name"
253249
)

tests/test_dls_python3_skeleton.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def test_existing_module(tmp_path: Path):
114114
"-m",
115115
"python3_pip_skeleton",
116116
"existing",
117+
"--org=epics-containers",
117118
str(module),
118119
)
119120
assert output.endswith(
@@ -134,6 +135,7 @@ def test_existing_module(tmp_path: Path):
134135
"-m",
135136
"python3_pip_skeleton",
136137
"existing",
138+
"--org=epics-containers",
137139
str(module),
138140
)
139141
assert (
@@ -172,6 +174,7 @@ def test_existing_module_already_adopted(tmp_path: Path):
172174
"-m",
173175
"python3_pip_skeleton",
174176
"existing",
177+
"--org=epics-containers",
175178
str(module),
176179
)
177180
assert "already adopted skeleton" in str(excinfo.value)

0 commit comments

Comments
 (0)