Skip to content

Commit 0b989ec

Browse files
authored
Merge pull request #29 from Materials-Data-Science-and-Informatics/update_deps
Update deps
2 parents e23c921 + d580170 commit 0b989ec

File tree

8 files changed

+707
-620
lines changed

8 files changed

+707
-620
lines changed

.pre-commit-config.yaml

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-
exclude: "src/fair_python_cookiecutter/template/.*" # <-- added
1+
exclude: 'src/fair_python_cookiecutter/template/.*' # <-- added
22
# ---- copy from template below ----
33
# See https://pre-commit.com for more information
44
# See https://pre-commit.com/hooks.html for more hooks
55
repos:
6-
# GH Actions
7-
- repo: https://github.com/python-jsonschema/check-jsonschema
8-
rev: "0.28.6"
9-
hooks:
10-
- id: check-github-workflows
6+
# GH Actions
7+
- repo: https://github.com/python-jsonschema/check-jsonschema
8+
rev: '0.28.6'
9+
hooks:
10+
- id: check-github-workflows
1111

12-
# Code Quality
13-
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.5.0
15-
hooks:
16-
- id: ruff
17-
types_or: [python, pyi, jupyter]
18-
args: [--fix]
19-
- id: ruff-format
20-
types_or: [python, pyi, jupyter]
12+
# Code Quality
13+
- repo: https://github.com/astral-sh/ruff-pre-commit
14+
rev: v0.5.0
15+
hooks:
16+
- id: ruff
17+
types_or: [python, pyi, jupyter]
18+
args: [--fix]
19+
- id: ruff-format
20+
types_or: [python, pyi, jupyter]
2121

22-
- repo: https://github.com/pre-commit/mirrors-mypy
23-
rev: "v1.10.1"
24-
hooks:
25-
- id: mypy
26-
args: [--no-strict-optional, --ignore-missing-imports]
27-
# NOTE: you might need to add some deps here:
28-
additional_dependencies: []
22+
- repo: https://github.com/pre-commit/mirrors-mypy
23+
rev: 'v1.10.1'
24+
hooks:
25+
- id: mypy
26+
args: [--no-strict-optional, --ignore-missing-imports]
27+
# NOTE: you might need to add some deps here:
28+
additional_dependencies: []
2929

30-
# Metadata
31-
- repo: https://github.com/citation-file-format/cff-converter-python
32-
rev: "054bda51dbe278b3e86f27c890e3f3ac877d616c"
33-
hooks:
34-
- id: validate-cff
35-
- repo: https://github.com/fsfe/reuse-tool
36-
rev: "v3.0.2"
37-
hooks:
38-
- id: reuse
30+
# Metadata
31+
- repo: https://github.com/citation-file-format/cff-converter-python
32+
rev: '054bda51dbe278b3e86f27c890e3f3ac877d616c'
33+
hooks:
34+
- id: validate-cff
35+
- repo: https://github.com/fsfe/reuse-tool
36+
rev: 'v3.0.2'
37+
hooks:
38+
- id: reuse
3939

40-
- repo: https://github.com/Materials-Data-Science-and-Informatics/somesy
41-
rev: "v0.4.2"
42-
hooks:
43-
- id: somesy
40+
- repo: https://github.com/Materials-Data-Science-and-Informatics/somesy
41+
rev: 'v0.4.3'
42+
hooks:
43+
- id: somesy
4444

45-
# Various general + format-specific helpers
46-
- repo: https://github.com/pre-commit/pre-commit-hooks
47-
rev: v4.6.0
48-
hooks:
49-
- id: check-symlinks
50-
- id: trailing-whitespace
51-
exclude: "CITATION.cff"
52-
- id: mixed-line-ending
53-
args: [--fix=lf]
54-
- id: check-yaml
55-
exclude: "mkdocs.yml"
56-
- id: check-toml
57-
- id: check-json
58-
- id: check-ast
59-
- id: debug-statements
60-
- id: check-merge-conflict
61-
- id: check-shebang-scripts-are-executable
62-
- id: check-added-large-files
63-
args: [--maxkb=10000]
45+
# Various general + format-specific helpers
46+
- repo: https://github.com/pre-commit/pre-commit-hooks
47+
rev: v4.6.0
48+
hooks:
49+
- id: check-symlinks
50+
- id: trailing-whitespace
51+
exclude: 'CITATION.cff'
52+
- id: mixed-line-ending
53+
args: [--fix=lf]
54+
- id: check-yaml
55+
exclude: 'mkdocs.yml'
56+
- id: check-toml
57+
- id: check-json
58+
- id: check-ast
59+
- id: debug-statements
60+
- id: check-merge-conflict
61+
- id: check-shebang-scripts-are-executable
62+
- id: check-added-large-files
63+
args: [--maxkb=10000]

README.md

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ An opinionated cookiecutter template to kickstart a modern best-practice Python
2020

2121
<!-- NOTE: For technical reasons, it is much easier to use GitHub
2222
for hosting the mindmap than adding it to the repository -->
23+
2324
![FAIR Software Mindmap](https://github.com/Materials-Data-Science-and-Informatics/fair-python-cookiecutter/assets/371708/ef566ee1-8965-4d58-9ede-18eeb49a476e)
2425

25-
*Check out the
26+
_Check out the
2627
[demo repository](https://github.com/Materials-Data-Science-and-Informatics/fair-python-cookiecutter-demo)
27-
generated from this template!*
28+
generated from this template!_
2829

2930
## Overview
3031

@@ -57,25 +58,25 @@ You can use it as is, adapt it, or at least get some inspiration for your projec
5758

5859
This template sets up a skeleton for a Python project that:
5960

60-
* uses modern state-of-the-art development tools
61-
* provides a baseline for professional development and maintenance
62-
* helps following best practices for code and metadata quality
63-
* contains detailed documentation on how to work with it
61+
- uses modern state-of-the-art development tools
62+
- provides a baseline for professional development and maintenance
63+
- helps following best practices for code and metadata quality
64+
- contains detailed documentation on how to work with it
6465

6566
It is built to help you adopting good practices
6667
and follow recommendations such as:
6768

68-
* [DLR Software Engineering Guidelines](https://rse.dlr.de/guidelines/00_dlr-se-guidelines_en.html)
69-
* [OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/en/criteria/0)
70-
* [Netherlands eScience Center](https://fair-software.eu)
71-
* innumerable other resources that can be found online
69+
- [DLR Software Engineering Guidelines](https://rse.dlr.de/guidelines/00_dlr-se-guidelines_en.html)
70+
- [OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/en/criteria/0)
71+
- [Netherlands eScience Center](https://fair-software.eu)
72+
- innumerable other resources that can be found online
7273

7374
Furthermore, it implements emerging standards with the goal to improve
7475
software metadata and make it more [FAIR](https://www.go-fair.org/fair-principles/):
7576

76-
* [REUSE](https://reuse.software/)
77-
* [CITATION.cff](https://citation-file-format.github.io/)
78-
* [CodeMeta](https://codemeta.github.io/)
77+
- [REUSE](https://reuse.software/)
78+
- [CITATION.cff](https://citation-file-format.github.io/)
79+
- [CodeMeta](https://codemeta.github.io/)
7980

8081
Also see [this paper](https://doi.org/10.48550/arXiv.1905.08674) for an overview and
8182
recommendations on the state of software citation in academic practice.
@@ -123,6 +124,39 @@ project contributors.
123124

124125
You can find a demo repository generated from this template [here](https://github.com/Materials-Data-Science-and-Informatics/fair-python-cookiecutter-demo).
125126

127+
### Example Code
128+
129+
When you are creating your project, you are asked for several inputs. You can have an example CLI(Command Line Interface) and/or API(Application Programming interface) code within your new project.
130+
131+
Lets assume your project name is `my-awesome-project`.
132+
133+
You can run the CLI App with below command. For further usage, please check typer documentation.
134+
135+
```bash
136+
poetry shell
137+
138+
# Run your CLI App
139+
my-awesome-project-cli calculate add 5 2
140+
```
141+
142+
You can run the API App with below command.
143+
144+
```bash
145+
poetry shell
146+
147+
# Run the API program, it will be open for connection
148+
my-awesome-project-api
149+
```
150+
151+
Now, you can a tool to send a HTTP request for the API. You can open another terminal and run this command
152+
153+
```
154+
# send a request that does the same thing as the CLI
155+
curl 'http://localhost:8000/calculate/add?x=5&y=2'
156+
```
157+
158+
For further usage of the API, please check fastAPI documentation.
159+
126160
## Configuring the Template
127161

128162
If you intend to use the template a lot, e.g. if you want to use (an adaptation of)
@@ -132,14 +166,14 @@ Here is an example cookiecutter configuration:
132166

133167
```yaml
134168
fair_python_cookiecutter:
135-
last_name: "Carberry"
136-
first_name: "Josiah"
137-
project_keywords: "psychoceramics analytics"
138-
139-
orcid: "0000-0002-1825-0097"
140-
affiliation: "Brown University"
141-
copyright_holder: "Brown University"
142-
license: "MIT"
169+
last_name: 'Carberry'
170+
first_name: 'Josiah'
171+
project_keywords: 'psychoceramics analytics'
172+
173+
orcid: '0000-0002-1825-0097'
174+
affiliation: 'Brown University'
175+
copyright_holder: 'Brown University'
176+
license: 'MIT'
143177
```
144178
145179
This information will be already pre-filled when you use the template,
@@ -176,9 +210,9 @@ moved into the `YOUR_PROJECT/src/YOUR_PACKAGE` subdirectory.
176210
On the other hand, if you already have a working setup that you do not wish to replace
177211
completely, you can take a look at
178212

179-
* the `.pre-commit-config.yaml` file to adopt some of the quality assurance tools listed there
180-
* the CI pipelines defined in `.github/workflows` or `.gitlab-ci.yml` for automated tests and releases
181-
* the `mkdocs.yml` and `docs/` subdirectory to see how the project website works
213+
- the `.pre-commit-config.yaml` file to adopt some of the quality assurance tools listed there
214+
- the CI pipelines defined in `.github/workflows` or `.gitlab-ci.yml` for automated tests and releases
215+
- the `mkdocs.yml` and `docs/` subdirectory to see how the project website works
182216

183217
<!-- --8<-- [end:quickstart] -->
184218

0 commit comments

Comments
 (0)