|
1 | 1 | # BAMDataStore |
2 | 2 |
|
| 3 | +This is the main repository of the BAM Data Store project. This is both a Python package and a web connecting the different resources for the Data Store. |
3 | 4 |
|
4 | 5 |
|
| 6 | +<!-- |
5 | 7 | ## Getting started |
6 | 8 |
|
7 | | -To make it easy for you to get started with GitLab, here's a list of recommended next steps. |
| 9 | + Add here installation instructions once the package is deployed --> |
8 | 10 |
|
9 | | -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! |
| 11 | +## Development |
10 | 12 |
|
11 | | -## Add your files |
12 | | - |
13 | | -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files |
14 | | -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: |
15 | | - |
16 | | -``` |
17 | | -cd existing_repo |
18 | | -git remote add origin https://git.bam.de/bam-data-store/bamdatastore.git |
19 | | -git branch -M main |
20 | | -git push -uf origin main |
| 13 | +If you want to develop locally this package, clone the project and enter in the workspace folder: |
| 14 | +```sh |
| 15 | +git clone https://git.bam.de/bam-data-store/bam-data-store.git |
| 16 | +cd bam-data-store |
21 | 17 | ``` |
22 | 18 |
|
23 | | -## Integrate with your tools |
24 | | - |
25 | | -- [ ] [Set up project integrations](https://git.bam.de/bam-data-store/bamdatastore/-/settings/integrations) |
26 | | - |
27 | | -## Collaborate with your team |
28 | | - |
29 | | -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) |
30 | | -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) |
31 | | -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) |
32 | | -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) |
33 | | -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) |
34 | | - |
35 | | -## Test and Deploy |
36 | | - |
37 | | -Use the built-in continuous integration in GitLab. |
| 19 | +Create a virtual environment (you can use Python>3.9) in your workspace: |
| 20 | +```sh |
| 21 | +python3 -m venv .venv |
| 22 | +source .venv/bin/activate |
| 23 | +``` |
38 | 24 |
|
39 | | -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) |
40 | | -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) |
41 | | -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) |
42 | | -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) |
43 | | -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) |
| 25 | +Run the following script: |
| 26 | +```sh |
| 27 | +./scripts/install_python_dependencies |
| 28 | +``` |
44 | 29 |
|
45 | | -*** |
46 | 30 |
|
47 | | -# Editing this README |
| 31 | +### Run the tests |
48 | 32 |
|
49 | | -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. |
| 33 | +You can locally run the tests by doing: |
| 34 | +```sh |
| 35 | +python -m pytest -sv tests |
| 36 | +``` |
50 | 37 |
|
51 | | -## Suggestions for a good README |
| 38 | +where the `-s` and `-v` options toggle the output verbosity. |
52 | 39 |
|
53 | | -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. |
| 40 | +You can also generate a local coverage report: |
| 41 | +```sh |
| 42 | +python -m pytest --cov=src tests |
| 43 | +``` |
54 | 44 |
|
55 | | -## Name |
56 | | -Choose a self-explaining name for your project. |
| 45 | +### Run auto-formatting and linting |
57 | 46 |
|
58 | | -## Description |
59 | | -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. |
| 47 | +We use [Ruff](https://docs.astral.sh/ruff/) for formatting and linting the code following the rules specified in the `pyproject.toml`. You can run locally: |
| 48 | +```sh |
| 49 | +ruff check . |
| 50 | +``` |
60 | 51 |
|
61 | | -## Badges |
62 | | -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. |
| 52 | +This will produce an output with the specific issues found. In order to auto-fix them, run: |
| 53 | +```sh |
| 54 | +ruff format . --check |
| 55 | +``` |
63 | 56 |
|
64 | | -## Visuals |
65 | | -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. |
| 57 | +If some issues are not possible to fix automatically, you will need to visit the file and fix them by hand. |
| 58 | + |
| 59 | +### Run the local website |
| 60 | + |
| 61 | +**Under construction!** |
| 62 | + |
| 63 | +<!-- ### Debugging |
| 64 | +
|
| 65 | +For interactive debugging of the tests, use `pytest` with the `--pdb` flag. We recommend using an IDE for debugging, e.g., _VSCode_. If that is the case, add the following snippet to your `.vscode/launch.json`: |
| 66 | +```json |
| 67 | +{ |
| 68 | + "configurations": [ |
| 69 | + { |
| 70 | + "name": "<descriptive tag>", |
| 71 | + "type": "debugpy", |
| 72 | + "request": "launch", |
| 73 | + "cwd": "${workspaceFolder}", |
| 74 | + "program": "${workspaceFolder}/.pyenv/bin/pytest", |
| 75 | + "justMyCode": true, |
| 76 | + "env": { |
| 77 | + "_PYTEST_RAISE": "1" |
| 78 | + }, |
| 79 | + "args": [ |
| 80 | + "-sv", |
| 81 | + "--pdb", |
| 82 | + "<path-to-plugin-tests>", |
| 83 | + ] |
| 84 | + } |
| 85 | + ] |
| 86 | +} |
| 87 | +``` |
66 | 88 |
|
67 | | -## Installation |
68 | | -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. |
| 89 | +where `<path-to-plugin-tests>` must be changed to the local path to the test module to be debugged. |
69 | 90 |
|
70 | | -## Usage |
71 | | -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. |
| 91 | +The settings configuration file `.vscode/settings.json` automatically applies the linting and formatting upon saving the modified file. --> |
72 | 92 |
|
73 | | -## Support |
74 | | -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. |
| 93 | +### Documentation on Github pages |
75 | 94 |
|
76 | | -## Roadmap |
77 | | -If you have ideas for releases in the future, it is a good idea to list them in the README. |
| 95 | +To view the documentation locally, make sure to have installed the extra packages (this is part of the `scripts/install_python_dependencies.sh`, so if you ran this script before, you don't need to do it again now): |
| 96 | +```sh |
| 97 | +uv pip install -e '[docu]' |
| 98 | +``` |
78 | 99 |
|
79 | | -## Contributing |
80 | | -State if you are open to contributions and what your requirements are for accepting them. |
| 100 | +The first time, build the server: |
| 101 | +```sh |
| 102 | +mkdocs build |
| 103 | +``` |
81 | 104 |
|
82 | | -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. |
| 105 | +Run the documentation server: |
| 106 | +```sh |
| 107 | +mkdocs serve |
| 108 | +``` |
83 | 109 |
|
84 | | -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. |
| 110 | +The output looks like: |
| 111 | +```sh |
| 112 | +INFO - Building documentation... |
| 113 | +INFO - Cleaning site directory |
| 114 | +INFO - [14:07:47] Watching paths for changes: 'docs', 'mkdocs.yml' |
| 115 | +INFO - [14:07:47] Serving on http://127.0.0.1:8000/ |
| 116 | +``` |
85 | 117 |
|
86 | | -## Authors and acknowledgment |
87 | | -Show your appreciation to those who have contributed to the project. |
| 118 | +Simply click on `http://127.0.0.1:8000/`. The changes in the `md` files of the documentation are inmediately reflected when the files are saved (the local web will automatically refresh). |
88 | 119 |
|
89 | | -## License |
90 | | -For open source projects, say how it is licensed. |
| 120 | +## Main contributors |
91 | 121 |
|
92 | | -## Project status |
93 | | -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. |
| 122 | +| Name | E-mail | Role | |
| 123 | +|------|------------|--------| |
| 124 | +| Dr. Angela Ariza | [[email protected]](mailto:[email protected]) | Outreach and Training | |
| 125 | +| Caroline Demidova | [[email protected]](mailto:[email protected]) | Outreach and Training | |
| 126 | +| Daniel Kosztyla | [[email protected]](mailto:[email protected]) | IT | |
| 127 | +| Carlos Madariaga | [[email protected]](mailto:[email protected]) | Software Developer | |
| 128 | +| Kristina Meindl | [[email protected]](mailto:[email protected]) | Project Manager | |
| 129 | +| Dr. Jose M. Pizarro | [[email protected]](mailto:[email protected]) | Data Management | |
| 130 | +| Jörg Rädler | [[email protected]](mailto:[email protected]) | IT | |
0 commit comments