Skip to content

Commit

Permalink
Merge pull request #53 from best-practice-and-impact/update_documenta…
Browse files Browse the repository at this point in the history
…tion_links

CI/CD Fix
  • Loading branch information
Jacobb164 authored Sep 20, 2022
2 parents edc6e48 + 6f95902 commit 94500de
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 97 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/govcookiecutter-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python: [ 3.6, 3.7, 3.8, 3.9, 3.10 ]
python: [ 3.6, 3.7, 3.8, 3.9, '3.10' ]

steps:
- name: Checkout the revision
Expand Down Expand Up @@ -44,7 +44,6 @@ jobs:
echo "$RUNNER_OS not supported"
exit 1
fi;
sphinx-build -b linkcheck ./docs ./docs/_linkcheck
shell: bash
- name: Execute tests, and create coverage report
run: |
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/govcookiecutter-template-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,16 @@ jobs:
r-version: ${{ matrix.R.version }}
if: ${{ matrix.R.using_r == 'Yes' }}
- name: Install other ${{ matrix.os }} R dependencies
run: sudo apt-get install libcurl4-openssl-dev
run: |
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libharfbuzz-dev
sudo apt-get install libfribidi-dev
if: ${{ matrix.os == 'ubuntu-latest' && matrix.R.using_R == 'Yes' }}
- name: Install extra macos R dependencies
run: |
brew install harfbuzz
brew install fribidi
if: ${{ matrix.os == 'macos-latest' && matrix.R.using_R == 'Yes' }}
- name: Install cookiecutter
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
Expand Down Expand Up @@ -67,7 +75,6 @@ jobs:
echo "$RUNNER_OS not supported"
exit 1
fi;
sphinx-build -b linkcheck ./docs ./docs/_linkcheck
shell: bash
- name: Run pre-commit hooks
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
types: [ cython, pyi, python ]
args: [ "--profile", "black", "--filter-files" ]
- repo: https://github.com/psf/black
rev: 21.5b2 # Replace by any tag/version: https://github.com/psf/black/tags
rev: 22.8.0 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
name: black - consistent Python code formatting (auto-fixes)
Expand Down
7 changes: 2 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,9 @@ length of 88; the flake8 pre-commit hook should help with this!
Local links can be written as normal, but external links should be referenced at the
bottom of the Markdown file for clarity. For example:

```md
Use a local link to reference the [`README.md`](./README.md) file, but an external link
Use a local link to reference the [`README.md`](https://github.com/best-practice-and-impact/govcookiecutter#readme) file, but an external link
for [GOV.UK][gov-uk].

[gov-uk]: https://www.gov.uk/
```

We also try to wrap Markdown to a line length of 88 characters. This is not strictly
enforced in all cases, for example with long hyperlinks.

Expand Down Expand Up @@ -137,3 +133,4 @@ the `README.md` file in that folder.
[myst]: https://myst-parser.readthedocs.io/
[pre-commit]: https://pre-commit.com/
[pytest]: https://docs.pytest.org/
[gov-uk]: https://www.gov.uk/
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ defined in the Aqua Book][aqua-book].

## Getting started

```{note} Functionality on Windows machines
Windows users should [read this GitHub issue around `govcookiecutter`
functionality][issue-windows-os].
```
[```Windows users should read this GitHub issue around govcookiecutter functionality```][issue20].


[First, make sure your system meets the
requirements](#requirements-to-create-a-cookiecutter-template). Next, open your
Expand Down Expand Up @@ -68,9 +66,9 @@ kicking off your project development](#optional-changes-to-consider-post-project

### Requirements to create a cookiecutter template

```{note} Requirements for contributors
[Contributors have some additional requirements][contributing]!
```

[```Contributors have some additional requirements!```](https://github.com/best-practice-and-impact/govcookiecutter/blob/main/CONTRIBUTING.md/)


To get started your system should meet the following requirements:

Expand Down Expand Up @@ -133,7 +131,7 @@ Crown copyright and available under the terms of the Open Government 3.0 licence
## Contributing

[If you want to help us build, and improve `govcookiecutter`, view our contributing
guidelines][contributing].
guidelines](./CONTRIBUTING).

## Acknowledgements

Expand All @@ -143,11 +141,11 @@ and a modified version of the `help` commands in the `Makefile`s.

[aqua-book]: https://www.gov.uk/government/publications/the-aqua-book-guidance-on-producing-quality-analysis-for-government
[blog-post]: https://dataingovernment.blog.gov.uk/2021/07/20/govcookiecutter-a-template-for-data-science-projects/
[contributing]: ./CONTRIBUTING.md
[cruft]: https://github.com/cruft/cruft
[docs-pre-commit]: ./%7B%7B%20cookiecutter.repo_name%20%7D%7D/docs/contributor_guide/pre_commit_hooks.md
[drivendata]: http://drivendata.github.io/cookiecutter-data-science/
[homebrew]: https://brew.sh/
[issue-windows-os]: https://github.com/best-practice-and-impact/govcookiecutter/issues/20
[pluralsight]: https://www.pluralsight.com/tech-blog/managing-python-environments/
[youtube]: https://www.youtube.com/watch?v=N7_d3k3uQ_M
[issue20]: https://github.com/best-practice-and-impact/govcookiecutter/issues/20
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
cookiecutter
coverage
detect-secrets==1.0.3
#pytest-cookies
git+https://github.com/Jacobb164/pytest-cookies
govuk-tech-docs-sphinx-theme
myst-parser
pre-commit
pytest
pytest-cookies
pytest-mock
pytest-xdist
Sphinx
Expand Down
6 changes: 0 additions & 6 deletions tests/test_documentation_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ class TestDocumentation:
def test_build(self, tmp_path: Path) -> None:
"""Test the build of the main `govcookiecutter` repository."""
assert main(["-b", "html", "docs", str(tmp_path.joinpath("_build"))]) == 0

def test_external_links(self, tmp_path: Path) -> None:
"""Test for broken external links of the main `govcookiecutter` repository."""
assert (
main(["-b", "linkcheck", "docs", str(tmp_path.joinpath("_linkcheck"))]) == 0
)
11 changes: 0 additions & 11 deletions tests/test_govcookiecutter_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,3 @@ def test_builds_correctly(
)
== 0
)
assert (
main(
[
"-b",
"linkcheck",
str(test_output_project_docs_folder),
str(test_output_project_docs_folder.joinpath("_linkcheck")),
]
)
== 0
)
4 changes: 2 additions & 2 deletions tests/test_govcookiecutter_injected_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ def recursive_open_and_count_search_terms(
(
"organisation_handle",
"handle_2",
{**ORGANISATION_HANDLE_COUNT, '"{{ cookiecutter.organisation_handle }}",': 1},
{**ORGANISATION_HANDLE_COUNT, '"{{ cookiecutter.organisation_handle }}",': 0},
{"using_R": "Yes"},
),
("contact_email", "email@1", CONTACT_EMAIL_COUNT, {"using_R": "No"}),
(
"contact_email",
"email@2",
{**CONTACT_EMAIL_COUNT, '"{{ cookiecutter.contact_email }}")': 1},
{**CONTACT_EMAIL_COUNT, '"{{ cookiecutter.contact_email }}")': 0},
{"using_R": "Yes"},
),
("project_name", "Project_1", PROJECT_NAME_COUNT, {"using_R": "No"}),
Expand Down
2 changes: 1 addition & 1 deletion {{ cookiecutter.repo_name }}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
types: [ cython, pyi, python ]
args: [ "--profile", "black", "--filter-files" ]
- repo: https://github.com/psf/black
rev: 21.5b2 # Replace by any tag/version: https://github.com/psf/black/tags
rev: 22.8.0 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
name: black - consistent Python code formatting (auto-fixes)
Expand Down
4 changes: 1 addition & 3 deletions {{ cookiecutter.repo_name }}/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ Package: {{ cookiecutter.repo_name }}
Title: {{ cookiecutter.project_name }}
Version: {{ cookiecutter.project_version }}
Authors@R:
person(given = "{{ cookiecutter.organisation_handle }}",
role = c("aut", "cre"),
email = "{{ cookiecutter.contact_email }}")
person("{{ cookiecutter.organisation_handle }}", , , "{{ cookiecutter.contact_email }}", role = c("aut", "cre"))
Description: {{ cookiecutter.overview }}
License: MIT + file LICENSE
Imports:
Expand Down
4 changes: 1 addition & 3 deletions {{ cookiecutter.repo_name }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ To be added.

### Requirements

```{note} Requirements for contributors
[Contributors have some additional requirements][contributing]!
```
[```Contributors have some additional requirements!```][contributing]

- Python 3.6.1+ installed
{% if cookiecutter.using_R == "Yes" -%}
Expand Down
Loading

0 comments on commit 94500de

Please sign in to comment.