-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
2,074 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
{ | ||
"template": "https://github.com/elixir-cloud-aai/cookiecutter-python", | ||
"commit": "43f9bd92eaf21557e87d3932524fe5ffb6fd7ef4", | ||
"commit": "fe9787042053d7cae1ccd7ff8d6fef4611f41b2a", | ||
"checkout": null, | ||
"context": { | ||
"cookiecutter": { | ||
"author_name": "ELIXIR Cloud AAI", | ||
"author_email": "[email protected]", | ||
"development_status": "Alpha", | ||
"short_description": "File handler utilizing TUS and MinIO with DRS-Filer integration", | ||
"development_status": "1 - Planning", | ||
"short_description": "File handler utilizing TUS and MinIO with DRS-Filer integration.", | ||
"project_name": "tus-storagehandler", | ||
"project_slug": "tus_storagehandler", | ||
"github_username": "elixir-cloud-aai", | ||
"python_version": "3.11", | ||
"add_script": "y", | ||
"add_script": "n", | ||
"year": "2024", | ||
"_template": "https://github.com/elixir-cloud-aai/cookiecutter-python" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,9 @@ | |
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to making participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, sex characteristics, gender identity and expression, | ||
level of experience, education, socio-economic status, nationality, personal | ||
appearance, race, religion, or sexual identity and orientation. | ||
size, disability, ethnicity, sex characteristics, gender identity and | ||
expression, level of experience, education, socio-economic status, nationality, | ||
personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
|
@@ -37,11 +37,11 @@ Project maintainers are responsible for clarifying the standards of acceptable | |
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
Project maintainers have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions that are | ||
not aligned to this Code of Conduct, or to ban temporarily or permanently any | ||
contributor for other behaviors that they deem inappropriate, threatening, | ||
offensive, or harmful. | ||
|
||
## Scope | ||
|
||
|
@@ -55,10 +55,11 @@ further defined and clarified by project maintainers. | |
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting [[email protected]][elixir-cloud-aai-email]. All complaints | ||
will be reviewed and investigated and will result in a response that is deemed | ||
necessary and appropriate to the circumstances. The project team is obligated | ||
to maintain confidentiality with regard to the reporter of an incident. Further | ||
reported by contacting | ||
[[email protected]][elixir-cloud-aai-email]. All complaints will | ||
be reviewed and investigated and will result in a response that is deemed | ||
necessary and appropriate to the circumstances. The project team is obligated to | ||
maintain confidentiality with regard to the reporter of an incident. Further | ||
details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
|
@@ -67,8 +68,8 @@ members of the project's leadership. | |
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor | ||
Covenant][contributor-covenant], version 1.4, available at | ||
This Code of Conduct is adapted from the | ||
[Contributor Covenant][contributor-covenant], version 1.4, available at | ||
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html> | ||
|
||
[contributor-covenant]: https://contributor-covenant.org/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,143 +1,90 @@ | ||
# Python Cookiecutter Template | ||
[](https://bandit.readthedocs.io/en/latest/) | ||
[](https://codecov.io/gh/elixir-cloud-aai/tus-storagehandler) | ||
[](https://tus_storagehandler.readthedocs.io/en/latest/?badge=latest) | ||
[](./LICENSE) | ||
[](https://www.python.org/) | ||
[](https://github.com/elixir-cloud-aai/tus-storagehandler/graphs/contributors) | ||
[](https://docs.astral.sh/ruff/) | ||
[](https://safetycli.com/product/safety-cli) | ||
|
||
This is a Cookiecutter template for creating a Python project with Poetry, | ||
including configurations for various project settings. | ||
# tus-storagehandler | ||
|
||
File handler utilizing TUS and MinIO with DRS-Filer integration. | ||
|
||
## Table of Contents | ||
|
||
- [Introduction](#introduction) | ||
- [Basic Usage](#basic-usage) | ||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [Configurations](#configurations) | ||
- [Package manager - Poetry](#package-manager---poetry) | ||
- [Linters and formatters - Ruff](#linters-and-formatters---ruff) | ||
- [Spell checker - Typos](#spell-checker---typos) | ||
- [Static type checker - Mypy](#static-type-checker---mypy) | ||
- [Documentation - Sphinx](#documentation---sphinx) | ||
- [Testing - pytest and pytest-cov](#testing---pytest-and-pytest-cov) | ||
- [CI/CD - GitHub Actions](#cicd---github-actions) | ||
- [Disclaimer](#disclaimer) | ||
- [Development](#development) | ||
- [Contributing](#contributing) | ||
- [Code of Conduct](#code-of-conduct) | ||
- [Versioning](#versioning) | ||
- [License](#license) | ||
- [Contact](#contact) | ||
|
||
## Usage | ||
## Basic Usage | ||
|
||
1. **Install cruft** (if you haven't already): | ||
## Installation | ||
|
||
```sh | ||
pip install cruft | ||
``` | ||
## Development | ||
|
||
For ease, certain scripts have been abbreviated in `Makefile`, make sure that | ||
have installed the dependencies before running the commands. | ||
|
||
2. **Generate a New Project**: | ||
> **Note**: `make` commands are only available for Unix-based systems. | ||
To view the commdands available, run: | ||
|
||
```sh | ||
cruft create https://github.com/elixir-cloud-aai/cookiecutter-python.git | ||
make | ||
``` | ||
|
||
### Don't wanna use cruft? | ||
|
||
You can also use the `cookiecutter` command directly: | ||
Here are certain commands that you might find useful: | ||
|
||
1. **Install cookiecutter** (if you haven't already): | ||
- Making a virtual environment | ||
|
||
```sh | ||
pip install cookiecutter | ||
make v | ||
``` | ||
|
||
2. **Generate a New Project**: | ||
- Installing dependencies | ||
|
||
```sh | ||
cookiecutter gh:elixir-cloud-aai/cookiecutter-python | ||
make i | ||
``` | ||
|
||
> **Note**: If you're using just `cookiecutter`, manually remove | ||
`update-template` job from `update.yaml` github action workflow file as | ||
`cookiecutter` doesn't support autosync like cruft. | ||
|
||
## Configurations | ||
|
||
### Package manager - Poetry | ||
- Running tests | ||
|
||
This project uses [Poetry][poetry-org] as a package manager. Check out the | ||
commands at the [official documentation][poetry-docs]. | ||
|
||
### Linters and formatters - Ruff | ||
|
||
To lint and format `Python` code files, it uses [Ruff][ruff], the default | ||
configuration is set in the `pyproject.toml` file. | ||
|
||
```toml | ||
select = [ | ||
"B", # flake8-bugbear | ||
"E", # pycodestyle | ||
"F", # Pyflakes | ||
"I", # isort | ||
"PL", # pylint | ||
"SIM", # flake8-simplify | ||
"UP", # pyupgrade | ||
] | ||
```sh | ||
make t | ||
``` | ||
|
||
To configure it to your needs, refer to the [rules documentation][rudff-linter] | ||
, and for formatter configuration, refer to the | ||
[configuration documentation][ruff-formatter]. | ||
- Running linter, formatter and spell checker | ||
|
||
### Spell checker - Typos | ||
|
||
If you want to ignore certain words, add them to the `pyproject.toml` file, | ||
under the `tool.typos.default.extend-words` key. | ||
|
||
```toml | ||
[tool.typos.default.extend-words] | ||
mke = 'mke' | ||
```sh | ||
make fl | ||
``` | ||
|
||
For further configuration, refer to the [typos docs][typos-docs]. | ||
- Building the documentation | ||
|
||
### Static type checker - Mypy | ||
|
||
Change the configuration in `pyproject.toml` file, for further information refer to | ||
the [documentation][mypy-config]. | ||
|
||
### Documentation - Sphinx | ||
|
||
Configuration for Sphinx is in the `docs/source/conf.py` file, for further info refer | ||
to the [Sphinx documentation][sphinx-docs]. The default configuration uses | ||
[furo theme][furo] and [ReadTheDocs][rtd] to host the documentation, you can | ||
change the configuration using `/docs/source/conf.py` and `.readthedocs.yml` | ||
file. | ||
|
||
> **Note**: Make sure to setup the `ReadTheDocs` account and add the project to | ||
the account to host the documentation. | ||
|
||
### Testing - pytest and pytest-cov | ||
|
||
Generate a coverage report using `pytest-cov` and uploads it to codecov.io. | ||
|
||
> **Note**: Make sure to setup the `Codecov` account and add the project to the | ||
account to host the coverage report and add github [token](#cicd---github-actions). | ||
|
||
## CI/CD - GitHub Actions | ||
```sh | ||
make d | ||
``` | ||
|
||
Here are the GitHub Actions Secrets that need to be included in the repository | ||
settings: | ||
- Running type checker | ||
|
||
- `PYPI_PASSWORD`: PyPI account password. | ||
- `CODECOV_TOKEN`: Codecov token. | ||
- `AUTO_UPDATE_GITHUB_TOKEN`: GitHub token with permissions to write to the repository. | ||
```sh | ||
make tc | ||
``` | ||
|
||
## Disclaimer | ||
- Running all pre-commit checks | ||
|
||
Some of the links and images have been hardcoded with `ELIXIR Cloud & AAI`'s | ||
assets in the documentation, please update them manually if needed. These | ||
assets **MUST** be included for projects owned by ELIXIR Cloud & AAI, but | ||
**MUST NOT** be included for projects that are not (personal projects, projects | ||
owned by other orgs). | ||
```sh | ||
make pc | ||
``` | ||
|
||
**Only`markdown` files and `images/` directory need to be changed.** | ||
> **Note**: This is not the complete list of commands, run `make` to find if | ||
> more have been added. | ||
## Contributing | ||
|
||
|
@@ -162,7 +109,7 @@ leaders. | |
## Versioning | ||
|
||
The project adopts the [semantic versioning][semver] scheme for versioning. | ||
Currently the service is in a pre-release stage, so changes to the API, | ||
Currently the software is in a pre-release stage, so changes to the API, | ||
including breaking changes, may occur at any time without further notice. | ||
|
||
## License | ||
|
@@ -174,13 +121,12 @@ copy of which is also available in [`LICENSE`][license]. | |
|
||
The project is maintained by [ELIXIR Cloud & AAI][elixir-cloud-aai], a Driver | ||
Project of the [Global Alliance for Genomics and Health (GA4GH)][ga4gh], under | ||
the umbrella of the [ELIXIR][elixir] [Compute Platform][elixir-compute]. | ||
the umbrella of the [ELIXIR] [Compute Platform][elixir-compute]. | ||
|
||
To get in touch with us, please use one of the following routes: | ||
|
||
- For filing bug reports, feature requests or other code-related issues, please | ||
make use of the project's | ||
[issue tracker](https://github.com/elixir-cloud-aai/cookiecutter-python/issues). | ||
make use of the project's [issue tracker][issue-tracker]. | ||
- For private/personal issues, more involved communication, or if you would like | ||
to join our team as a regular contributor, you can either join our | ||
[chat board][badge-chat-url] or [email] the community leaders. | ||
|
@@ -196,17 +142,8 @@ To get in touch with us, please use one of the following routes: | |
[elixir-compute]: https://elixir-europe.org/platforms/compute | ||
[email]: mailto:[email protected] | ||
[ga4gh]: https://ga4gh.org/ | ||
[issue-tracker]: https://github.com/elixir-cloud-aai/tus-storagehandler/issues | ||
[license]: LICENSE | ||
[logo-elixir]: images/logo-elixir.svg | ||
[logo-elixir-cloud-aai]: images/logo-elixir-cloud-aai.svg | ||
[poetry-org]: https://python-poetry.org/ | ||
[poetry-docs]: https://python-poetry.org/docs/cli/ | ||
[ruff]: https://docs.astral.sh/ruff | ||
[ruff-linter]: https://docs.astral.sh/ruff/rules/ | ||
[ruff-formatter]: https://docs.astral.sh/ruff/formatter | ||
[typos-docs]: https://pypi.org/project/typos/ | ||
[mypy-config]: https://mypy.readthedocs.io/en/stable/config_file.html | ||
[sphinx-docs]: https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
[furo]: https://pradyunsg.me/furo/quickstart/ | ||
[rtd]: https://readthedocs.org/ | ||
[semver]:https://semver.org/ | ||
[semver]: https://semver.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.