-
Notifications
You must be signed in to change notification settings - Fork 1
chore: add project boilerplate from template #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ecf3f91
init cookie-cutter
pushkarm029 e38b231
fix
pushkarm029 3687004
fix
pushkarm029 ef7e794
ffix
pushkarm029 dfe7180
fix
pushkarm029 de82c29
removed unnecessary excludes
pushkarm029 0550f8a
fix
pushkarm029 96d6d63
s
pushkarm029 8f6791b
updated to latest cookiecutter
pushkarm029 cb69763
fix
pushkarm029 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "template": "https://github.com/elixir-cloud-aai/cookiecutter-python.git", | ||
| "commit": "d8b9cf3f288d0144f826181f18a5521285193142", | ||
| "checkout": null, | ||
| "context": { | ||
| "cookiecutter": { | ||
| "author_name": "ELIXIR Cloud AAI", | ||
| "author_email": "cloud-service@elixir-europe.org", | ||
| "development_status": "1 - Planning", | ||
| "short_description": "Integrating Telemetry into GA4GH API-powered federated microservice networks", | ||
| "project_name": "Cloud Telemetry", | ||
| "project_name_dashed": "cloud-telemetry", | ||
| "project_name_underscored": "cloud_telemetry", | ||
| "github_username": "elixir-cloud-aai", | ||
| "python_version": "3.11", | ||
| "add_script": "y", | ||
| "year": "2024", | ||
| "add_pypi_release_ci": "y", | ||
| "_template": "https://github.com/elixir-cloud-aai/cookiecutter-python.git" | ||
| } | ||
| }, | ||
| "directory": null | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| Your issue may already be reported! Please search on the | ||
| [issue tracker][issue-tracker] before creating one. | ||
|
|
||
| ## Expected behavior | ||
|
|
||
| <!--- If you're describing a bug, tell us what should happen --> | ||
|
|
||
| <!--- If you're suggesting a change/improvement, tell us how it should work --> | ||
|
|
||
| ## Current behavior | ||
|
|
||
| <!--- If describing a bug, tell us what happens instead of the expected | ||
| behavior --> | ||
|
|
||
| <!--- If suggesting a change/improvement, explain the difference from current | ||
| behavior --> | ||
|
|
||
| ## Possible solution | ||
|
|
||
| <!--- Not obligatory, but suggest a fix/reason for the bug, --> | ||
|
|
||
| <!--- or ideas how to implement the addition or change --> | ||
|
|
||
| ## Context | ||
|
|
||
| <!--- How has this issue affected you? What are you trying to accomplish? --> | ||
|
|
||
| <!--- Providing context helps us come up with a solution that is most useful in | ||
| the real world --> | ||
|
|
||
| ## Steps to reproduce (FOR BUGS) | ||
|
|
||
| <!--- Provide a link to a live example, or an unambiguous set of steps to --> | ||
|
|
||
| <!--- reproduce this bug. Include code to reproduce, if relevant --> | ||
|
|
||
| 1. | ||
|
|
||
| ## Your environment (FOR BUGS) | ||
|
|
||
| <!--- Include as many relevant details about the environment you experienced the | ||
| bug in --> | ||
|
|
||
| - Version used: | ||
| - Browser Name and version: | ||
| - Operating System and version (desktop or mobile): | ||
| - Link to your project: | ||
|
|
||
| [issue-tracker]: https://github.com/elixir-cloud-aai/cloud-telemetry/issues |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| --- | ||
| name: Setup Python and Poetry Action | ||
| description: Configure system, Python, Poetry and deps and cache management. | ||
|
|
||
| inputs: | ||
| os: | ||
| default: ubuntu-latest | ||
| description: The operating system to use | ||
| python-version: | ||
| default: '3.11' | ||
| description: The version of Python to use | ||
| poetry-version: | ||
| default: '1.8.2' | ||
| description: The version of Poetry to install | ||
| poetry-install-options: | ||
| default: '' | ||
| description: Additional options to pass to poetry install | ||
| poetry-export-options: | ||
| default: '' | ||
| description: Options to pass to poetry export for hash generation for cache | ||
| invalidation | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: 'actions/setup-python@v5' | ||
| id: setup-python | ||
| with: | ||
| python-version: '${{ inputs.python-version }}' | ||
|
|
||
| - name: Setup pipx environment Variables | ||
| id: pipx-env-setup | ||
| # pipx default home and bin dir are not writable by the cache action | ||
| # so override them here and add the bin dir to PATH for later steps. | ||
| # This also ensures the pipx cache only contains poetry | ||
| run: | | ||
| SEP="${{ !startsWith(runner.os, 'windows') && '/' || '\\' }}" | ||
| PIPX_CACHE="${{ github.workspace }}${SEP}pipx_cache" | ||
| echo "pipx-cache-path=${PIPX_CACHE}" >> $GITHUB_OUTPUT | ||
| echo "pipx-version=$(pipx --version)" >> $GITHUB_OUTPUT | ||
| echo "PIPX_HOME=${PIPX_CACHE}${SEP}home" >> $GITHUB_ENV | ||
| echo "PIPX_BIN_DIR=${PIPX_CACHE}${SEP}bin" >> $GITHUB_ENV | ||
| echo "PIPX_MAN_DIR=${PIPX_CACHE}${SEP}man" >> $GITHUB_ENV | ||
| echo "${PIPX_CACHE}${SEP}bin" >> $GITHUB_PATH | ||
| shell: bash | ||
|
|
||
| - name: Pipx cache | ||
| id: pipx-cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.pipx-env-setup.outputs.pipx-cache-path }} | ||
| key: ${{ runner.os }}-python- | ||
| ${{ steps.setup-python.outputs.python-version }}- | ||
| pipx-${{ steps.pipx-env-setup.outputs.pipx-version }}- | ||
| poetry-${{ inputs.poetry-version }} | ||
|
|
||
| - name: Install poetry | ||
| if: steps.pipx-cache.outputs.cache-hit != 'true' | ||
| id: install-poetry | ||
| shell: bash | ||
| run: | | ||
| pipx install poetry \ | ||
| --python "${{ steps.setup-python.outputs.python-path }}" | ||
|
|
||
| - name: Read poetry cache location | ||
| id: poetry-cache-location | ||
| shell: bash | ||
| run: | | ||
| echo "poetry-venv-location=$(poetry config virtualenvs.path)" \ | ||
| >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Generate hash only for required deps | ||
| run: | | ||
| poetry export ${{ inputs.poetry-export-options }} \ | ||
| --format=requirements.txt --output=requirements.txt | ||
| echo "DEP_HASH=$(sha256sum requirements.txt | cut -d ' ' -f 1)" \ | ||
| >> $GITHUB_ENV | ||
| shell: bash | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Poetry cache | ||
| with: | ||
| path: ${{ steps.poetry-cache-location.outputs.poetry-venv-location }} | ||
| key: ${{ runner.os }}-[python- | ||
| ${{ steps.setup-python.outputs.python-version }}]-[ | ||
| ${{ env.DEP_HASH }}]-[${{ inputs.poetry-install-options }}] | ||
|
|
||
| - name: 'Poetry install' | ||
| if: steps.poetry-cache.outputs.cache-hit != 'true' | ||
| shell: bash | ||
| run: poetry install ${{ inputs.poetry-install-options }} --no-interaction | ||
| ... |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| name: Code quality | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| format: | ||
| name: Format | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up environment | ||
| uses: ./.github/actions/setup/poetry | ||
| with: | ||
| os: ${{ job.os }} | ||
| python-version: '3.11' | ||
| poetry-install-options: "--only=code_quality --no-root" | ||
| poetry-export-options: "--only=code_quality" | ||
|
|
||
| - name: Check code style | ||
| run: poetry run ruff format --check | ||
|
|
||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up environment | ||
| uses: ./.github/actions/setup/poetry | ||
| with: | ||
| os: ${{ job.os }} | ||
| python-version: '3.11' | ||
| poetry-install-options: "--only=code_quality --no-root" | ||
| poetry-export-options: "--only=code_quality" | ||
|
|
||
| - name: Check code quality | ||
| run: poetry run ruff check . | ||
|
|
||
| spell-check: | ||
| name: Spell check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up environment | ||
| uses: ./.github/actions/setup/poetry | ||
| with: | ||
| os: ${{ job.os }} | ||
| python-version: '3.11' | ||
| poetry-install-options: "--only=code_quality --no-root" | ||
| poetry-export-options: "--only=code_quality" | ||
|
|
||
| - name: Check spellings | ||
| run: poetry run typos . | ||
|
|
||
| type-check: | ||
| name: Type check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up environment | ||
| uses: ./.github/actions/setup/poetry | ||
| with: | ||
| os: ${{ job.os }} | ||
| python-version: '3.11' | ||
| poetry-install-options: "--with=code_quality --with=types --no-root" | ||
| poetry-export-options: "--with=code_quality --with=types" | ||
|
|
||
| - name: Check types | ||
| run: poetry run mypy cloud_telemetry/ | ||
| ... | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| --- | ||
| name: Code test | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| integration-test: | ||
| name: Integration test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up environment | ||
| uses: ./.github/actions/setup/poetry | ||
| with: | ||
| os: ${{ job.os }} | ||
| python-version: '3.11' | ||
| poetry-install-options: "--with=test" | ||
| poetry-export-options: "--with=test" | ||
|
|
||
| - name: Run tests and generate coverage as test_integration.xml | ||
| run: | | ||
| poetry run pytest \ | ||
| --cov-report term \ | ||
| --cov-report xml:test_integration.xml \ | ||
| --cov=tests/test_integration | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| flags: test_integration | ||
| files: ./test_integration.xml | ||
| fail_ci_if_error: true | ||
| verbose: true | ||
|
|
||
| unit-test: | ||
| name: Unit test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up environment | ||
| uses: ./.github/actions/setup/poetry | ||
| with: | ||
| os: ${{ job.os }} | ||
| python-version: '3.11' | ||
| poetry-install-options: "--with=test" | ||
| poetry-export-options: "--with=test" | ||
|
|
||
| - name: Run tests and generate coverage as test_unit.xml | ||
| run: | | ||
| poetry run pytest \ | ||
| --cov-report term \ | ||
| --cov-report xml:test_unit.xml \ | ||
| --cov=tests/test_unit | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| flags: test_unit | ||
| files: ./test_unit.xml | ||
| fail_ci_if_error: true | ||
| verbose: true | ||
| ... |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| --- | ||
| name: Documentation check | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| check-api-docs: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up environment | ||
| uses: ./.github/actions/setup/poetry | ||
| with: | ||
| os: ${{ job.os }} | ||
| python-version: '3.11' | ||
| poetry-install-options: "--with=docs --with=types --no-root" | ||
| poetry-export-options: "--with=docs --with=types" | ||
|
|
||
| - name: Generate API docs | ||
| run: | | ||
| poetry run sphinx-apidoc \ | ||
| -o /tmp/docs/source/pages \ | ||
| cloud_telemetry/ | ||
|
|
||
| - name: Compare current docs with latest docs | ||
| id: check_docs_diff | ||
| run: | | ||
| shasum /tmp/docs/source/pages/* > /tmp/docs.sha | ||
| shasum docs/source/pages/* > docs/project_doc.sha | ||
| awk '{print $1}' /tmp/docs.sha > /tmp/docs_hashes.sha | ||
| awk '{print $1}' docs/project_doc.sha > docs/project_doc_hashes.sha | ||
| diff=$(diff /tmp/docs_hashes.sha docs/project_doc_hashes.sha) || true | ||
| if [[ -n "$diff" ]]; then | ||
| echo "::error::API documentation is out of date." | ||
| exit 1 | ||
| else | ||
| echo "API documentation is up to date." | ||
| fi | ||
| ... |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.