Skip to content

Commit cabab23

Browse files
authored
Simplify generation repo using README as index (#11)
* Simplify generation repo using README as index * Fix path
1 parent 9244929 commit cabab23

9 files changed

Lines changed: 32 additions & 58 deletions

File tree

.github/workflows/build_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ concurrency:
2323

2424
env:
2525
# Directory that will be published on github pages
26-
PUBLISH_DIR: ./docs/_build/html
26+
PUBLISH_DIR: ./_build/html
2727

2828
jobs:
2929

@@ -43,7 +43,7 @@ jobs:
4343
run: python3 -m pip install -r requirements.txt
4444

4545
- name: Build docs
46-
run: jupyter book build -W docs
46+
run: jupyter book build -W .
4747

4848
- name: Upload artifact
4949
uses: actions/upload-pages-artifact@v1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,5 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
_build/

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# Template repository for reproducible research
1+
# Template repository for Python packages
2+
23
Repository using [Cookiecutter](https://cookiecutter.readthedocs.io/en/stable/README.html) for project templates.
34

45
## Installation
56
To use this repository, you need to install cookiecutter. This can be done with `pip`
67
```bash
7-
pip install cookiecutter
8+
python3 -m pip install cookiecutter
89
```
910
For other installation options, see: [Cookiecutter installation](https://cookiecutter.readthedocs.io/en/stable/installation.html)
1011

@@ -14,7 +15,25 @@ You also need to have `git` installed on your system, see:
1415
## Usage
1516
To use this repository with cookiecutter you can call:
1617
```bash
17-
cookiecutter gh:scientificcomputing/template-repo
18+
cookiecutter gh:scientificcomputing/generate-python-package
1819
```
1920
and fill out the list of options.
20-
See: [https://scientificcomputing.github.io/template-repo](https://scientificcomputing.github.io/template-repo) for documentation.
21+
22+
# Options for cookiecutter
23+
The following options are available when using the cookiecutter:
24+
25+
1. __Full Name__: Will appear in the `pyproject.toml` file as the author. Will also be used as author of the documentation generated by [jupyter-book](https://scientificcomputing.github.io/reproducibility/part3/publishing.html).
26+
2. __Email__: Will be used in `pyproject.toml` for package information.
27+
3. __github\_username__: Will be used to fetch the correct links for the documentation and [license badge](https://scientificcomputing.github.io/reproducibility/part5/badges.html#licence).
28+
4. __project\_name__: Used in various headers of the documentation
29+
5. __repository\_name__: Name of the repository
30+
6. __package\_name__: Name of the python package.
31+
7. __project\_short\_description__: Using in `pyproject.toml`
32+
8. __version__: The initial version of the software.
33+
9. __linting__: Enable linting, i.e. [mypy](https://scientificcomputing.github.io/reproducibility/part1/typing.html) and [flake8](https://scientificcomputing.github.io/reproducibility/part1/linting.html). This also enables the "Check Formatting" Github action.
34+
10. __testing__: Choose testing framework. If not `none` it creates a test folder with an initial test. Also adds [optional installation dependencies](https://scientificcomputing.github.io/reproducibility/part1/packaging.html#optional-dependencies) to `pyproject.toml`. Creates a "Test Package" Github action. If `pytest-cov` is chosen, it adds settings to generate a coverage report and publsuh them as a [Github artifact](https://scientificcomputing.github.io/reproducibility/part1/coverage.html).
35+
11. __use\_argparse__: Makes it possible to run the package as `module_name` or `python -m module_name` with inputs from the command line.
36+
12. __build\_docs__: Build a webpage with documentation (including a package API).
37+
13. __use_pre_commit__: Set up [pre-commit hooks](https://pre-commit.com) that will run some tests every time you make a commit.
38+
14. __docker__: Adds a Dockerfile that includes the module (not including optional dependencies). Adds a [publishing workflow](https://scientificcomputing.github.io/reproducibility/part4/docker.html#github-packages).
39+
15. __open\_source\_license__: Choose a open source license for your code

docs/_config.yml renamed to _config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ sphinx:
2929
extra_extensions:
3030
- 'sphinx.ext.autodoc'
3131
- 'sphinx.ext.napoleon'
32-
- 'sphinx.ext.viewcode'
32+
- 'sphinx.ext.viewcode'
33+
34+
exclude_patterns: ["**cookiecutter.repository_name**"]

_toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
format: jb-book
2+
root: README

docs/_toc.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/index.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/options.md

Lines changed: 0 additions & 18 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)