cryoemmonitor 0.2.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. cryoemmonitor-0.2.10/.bumpversion.toml +14 -0
  2. cryoemmonitor-0.2.10/.codecov.yaml +16 -0
  3. cryoemmonitor-0.2.10/.copier-answers.yml +16 -0
  4. cryoemmonitor-0.2.10/.devcontainer/devcontainer.json +46 -0
  5. cryoemmonitor-0.2.10/.github/CONTRIBUTING.md +27 -0
  6. cryoemmonitor-0.2.10/.github/actions/install_requirements/action.yml +34 -0
  7. cryoemmonitor-0.2.10/.github/dependabot.yml +24 -0
  8. cryoemmonitor-0.2.10/.github/pages/index.html +11 -0
  9. cryoemmonitor-0.2.10/.github/pages/make_switcher.py +94 -0
  10. cryoemmonitor-0.2.10/.github/workflows/_check.yml +27 -0
  11. cryoemmonitor-0.2.10/.github/workflows/_dist.yml +32 -0
  12. cryoemmonitor-0.2.10/.github/workflows/_release.yml +32 -0
  13. cryoemmonitor-0.2.10/.github/workflows/_test.yml +62 -0
  14. cryoemmonitor-0.2.10/.github/workflows/_tox.yml +22 -0
  15. cryoemmonitor-0.2.10/.github/workflows/ci.yml +73 -0
  16. cryoemmonitor-0.2.10/.gitignore +73 -0
  17. cryoemmonitor-0.2.10/.pre-commit-config.yaml +39 -0
  18. cryoemmonitor-0.2.10/.vscode/extensions.json +5 -0
  19. cryoemmonitor-0.2.10/.vscode/launch.json +23 -0
  20. cryoemmonitor-0.2.10/.vscode/settings.json +11 -0
  21. cryoemmonitor-0.2.10/.vscode/tasks.json +16 -0
  22. cryoemmonitor-0.2.10/Dockerfile +13 -0
  23. cryoemmonitor-0.2.10/LICENSE +201 -0
  24. cryoemmonitor-0.2.10/PKG-INFO +288 -0
  25. cryoemmonitor-0.2.10/README.md +45 -0
  26. cryoemmonitor-0.2.10/catalog-info.yaml +15 -0
  27. cryoemmonitor-0.2.10/grafana/template.json +40 -0
  28. cryoemmonitor-0.2.10/pyproject.toml +119 -0
  29. cryoemmonitor-0.2.10/setup.cfg +4 -0
  30. cryoemmonitor-0.2.10/src/cryoem_monitor/__init__.py +1 -0
  31. cryoemmonitor-0.2.10/src/cryoem_monitor/cli/__init__.py +0 -0
  32. cryoemmonitor-0.2.10/src/cryoem_monitor/cli/main.py +51 -0
  33. cryoemmonitor-0.2.10/src/cryoem_monitor/client/__init__.py +0 -0
  34. cryoemmonitor-0.2.10/src/cryoem_monitor/client/logger.py +400 -0
  35. cryoemmonitor-0.2.10/src/cryoem_monitor/client/parameter_names.json +266 -0
  36. cryoemmonitor-0.2.10/src/cryoem_monitor/server/__init__.py +0 -0
  37. cryoemmonitor-0.2.10/src/cryoem_monitor/server/config.py +35 -0
  38. cryoemmonitor-0.2.10/src/cryoem_monitor/server/grafana_export.py +252 -0
  39. cryoemmonitor-0.2.10/src/cryoem_monitor/server/prometheus.py +160 -0
  40. cryoemmonitor-0.2.10/src/cryoemmonitor.egg-info/PKG-INFO +288 -0
  41. cryoemmonitor-0.2.10/src/cryoemmonitor.egg-info/SOURCES.txt +45 -0
  42. cryoemmonitor-0.2.10/src/cryoemmonitor.egg-info/dependency_links.txt +1 -0
  43. cryoemmonitor-0.2.10/src/cryoemmonitor.egg-info/entry_points.txt +10 -0
  44. cryoemmonitor-0.2.10/src/cryoemmonitor.egg-info/requires.txt +28 -0
  45. cryoemmonitor-0.2.10/src/cryoemmonitor.egg-info/top_level.txt +1 -0
  46. cryoemmonitor-0.2.10/tests/conftest.py +15 -0
  47. cryoemmonitor-0.2.10/tests/test_cli.py +7 -0
@@ -0,0 +1,14 @@
1
+ [tool.bumpversion]
2
+ current_version = "0.2.10"
3
+ commit = true
4
+ tag = true
5
+
6
+ [[tool.bumpversion.files]]
7
+ filename = "pyproject.toml"
8
+ search = 'version = "{current_version}"'
9
+ replace = 'version = "{new_version}"'
10
+
11
+ [[tool.bumpversion.files]]
12
+ filename = "src/cryoem_monitor/__init__.py"
13
+ search = '__version__ = "{current_version}"'
14
+ replace = '__version__ = "{new_version}"'
@@ -0,0 +1,16 @@
1
+ coverage:
2
+ status:
3
+ project:
4
+ default:
5
+ target: 0%
6
+ threshold: 100%
7
+ patch:
8
+ default:
9
+ target: 0%
10
+ threshold: 100%
11
+
12
+ comment:
13
+ layout: "diff, flags"
14
+ branches:
15
+ - main
16
+ after_n_builds: 2
@@ -0,0 +1,16 @@
1
+ # Changes here will be overwritten by Copier
2
+ _commit: 2.1.0
3
+ _src_path: gh:DiamondLightSource/python-copier-template
4
+ author_email: thomas.thomas@diamond.ac.uk
5
+ author_name: Thomas Thomas
6
+ component_owner: group:default/sscc
7
+ description: Electron Microscope monitoring system using prometheus
8
+ distribution_name: cryoem-monitor
9
+ docker: false
10
+ docs_type: README
11
+ git_platform: github.com
12
+ github_org: DiamondLightSource
13
+ package_name: cryoem-monitor
14
+ pypi: false
15
+ repo_name: cryoem-monitor
16
+ type_checker: mypy
@@ -0,0 +1,46 @@
1
+ // For format details, see https://containers.dev/implementors/json_reference/
2
+ {
3
+ "name": "Python 3 Developer Container",
4
+ "build": {
5
+ "dockerfile": "../Dockerfile",
6
+ "target": "developer"
7
+ },
8
+ "remoteEnv": {
9
+ // Allow X11 apps to run inside the container
10
+ "DISPLAY": "${localEnv:DISPLAY}"
11
+ },
12
+ "customizations": {
13
+ "vscode": {
14
+ // Set *default* container specific settings.json values on container create.
15
+ "settings": {
16
+ "python.defaultInterpreterPath": "/venv/bin/python"
17
+ },
18
+ // Add the IDs of extensions you want installed when the container is created.
19
+ "extensions": [
20
+ "ms-python.python",
21
+ "github.vscode-github-actions",
22
+ "tamasfe.even-better-toml",
23
+ "redhat.vscode-yaml",
24
+ "ryanluker.vscode-coverage-gutters",
25
+ "charliermarsh.ruff",
26
+ "ms-azuretools.vscode-docker"
27
+ ]
28
+ }
29
+ },
30
+ "features": {
31
+ // Some default things like git config
32
+ "ghcr.io/devcontainers/features/common-utils:2": {
33
+ "upgradePackages": false
34
+ }
35
+ },
36
+ "runArgs": [
37
+ // Allow the container to access the host X11 display and EPICS CA
38
+ "--net=host",
39
+ // Make sure SELinux does not disable with access to host filesystems like tmp
40
+ "--security-opt=label=disable"
41
+ ],
42
+ // Mount the parent as /workspaces so we can pip install peers as editable
43
+ "workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
44
+ // After the container is created, install the python project in editable form
45
+ "postCreateCommand": "pip install $([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e '.[dev]' && pre-commit install"
46
+ }
@@ -0,0 +1,27 @@
1
+ # Contribute to the project
2
+
3
+ Contributions and issues are most welcome! All issues and pull requests are
4
+ handled through [GitHub](https://github.com/DiamondLightSource/cryoem-monitor/issues). Also, please check for any existing issues before
5
+ filing a new one. If you have a great idea but it involves big changes, please
6
+ file a ticket before making a pull request! We want to make sure you don't spend
7
+ your time coding something that might not fit the scope of the project.
8
+
9
+ ## Issue or Discussion?
10
+
11
+ Github also offers [discussions](https://github.com/DiamondLightSource/cryoem-monitor/discussions) as a place to ask questions and share ideas. If
12
+ your issue is open ended and it is not obvious when it can be "closed", please
13
+ raise it as a discussion instead.
14
+
15
+ ## Code Coverage
16
+
17
+ While 100% code coverage does not make a library bug-free, it significantly
18
+ reduces the number of easily caught bugs! Please make sure coverage remains the
19
+ same or is improved by a pull request!
20
+
21
+ ## Developer Information
22
+
23
+ It is recommended that developers use a [vscode devcontainer](https://code.visualstudio.com/docs/devcontainers/containers). This repository contains configuration to set up a containerized development environment that suits its own needs.
24
+
25
+ This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.
26
+
27
+ For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/2.1.0/how-to.html).
@@ -0,0 +1,34 @@
1
+ name: Install requirements
2
+ description: Install a version of python then call pip install and report what was installed
3
+ inputs:
4
+ python-version:
5
+ description: Python version to install, default is from Dockerfile
6
+ default: "dev"
7
+ pip-install:
8
+ description: Parameters to pass to pip install
9
+ default: "$([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e .[dev]"
10
+
11
+ runs:
12
+ using: composite
13
+ steps:
14
+ - name: Get version of python
15
+ run: |
16
+ PYTHON_VERSION="${{ inputs.python-version }}"
17
+ if [ $PYTHON_VERSION == "dev" ]; then
18
+ PYTHON_VERSION=$(sed -n "s/ARG PYTHON_VERSION=//p" Dockerfile)
19
+ fi
20
+ echo "PYTHON_VERSION=$PYTHON_VERSION" >> "$GITHUB_ENV"
21
+ shell: bash
22
+
23
+ - name: Setup python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: ${{ env.PYTHON_VERSION }}
27
+
28
+ - name: Install packages
29
+ run: pip install ${{ inputs.pip-install }}
30
+ shell: bash
31
+
32
+ - name: Report what was installed
33
+ run: pip freeze
34
+ shell: bash
@@ -0,0 +1,24 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "github-actions"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
12
+ groups:
13
+ actions:
14
+ patterns:
15
+ - "*"
16
+
17
+ - package-ecosystem: "pip"
18
+ directory: "/"
19
+ schedule:
20
+ interval: "weekly"
21
+ groups:
22
+ dev-dependencies:
23
+ patterns:
24
+ - "*"
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <title>Redirecting to main branch</title>
6
+ <meta charset="utf-8">
7
+ <meta http-equiv="refresh" content="0; url=./main/index.html">
8
+ <link rel="canonical" href="main/index.html">
9
+ </head>
10
+
11
+ </html>
@@ -0,0 +1,94 @@
1
+ import json
2
+ import logging
3
+ from argparse import ArgumentParser
4
+ from pathlib import Path
5
+ from subprocess import CalledProcessError, check_output
6
+
7
+
8
+ def report_output(stdout: bytes, label: str) -> list[str]:
9
+ ret = stdout.decode().strip().split("\n")
10
+ print(f"{label}: {ret}")
11
+ return ret
12
+
13
+
14
+ def get_branch_contents(ref: str) -> list[str]:
15
+ """Get the list of directories in a branch."""
16
+ stdout = check_output(["git", "ls-tree", "-d", "--name-only", ref])
17
+ return report_output(stdout, "Branch contents")
18
+
19
+
20
+ def get_sorted_tags_list() -> list[str]:
21
+ """Get a list of sorted tags in descending order from the repository."""
22
+ stdout = check_output(["git", "tag", "-l", "--sort=-v:refname"])
23
+ return report_output(stdout, "Tags list")
24
+
25
+
26
+ def get_versions(ref: str, add: str | None) -> list[str]:
27
+ """Generate the file containing the list of all GitHub Pages builds."""
28
+ # Get the directories (i.e. builds) from the GitHub Pages branch
29
+ try:
30
+ builds = set(get_branch_contents(ref))
31
+ except CalledProcessError:
32
+ builds = set()
33
+ logging.warning(f"Cannot get {ref} contents")
34
+
35
+ # Add and remove from the list of builds
36
+ if add:
37
+ builds.add(add)
38
+
39
+ # Get a sorted list of tags
40
+ tags = get_sorted_tags_list()
41
+
42
+ # Make the sorted versions list from main branches and tags
43
+ versions: list[str] = []
44
+ for version in ["master", "main"] + tags:
45
+ if version in builds:
46
+ versions.append(version)
47
+ builds.remove(version)
48
+
49
+ # Add in anything that is left to the bottom
50
+ versions += sorted(builds)
51
+ print(f"Sorted versions: {versions}")
52
+ return versions
53
+
54
+
55
+ def write_json(path: Path, repository: str, versions: str):
56
+ org, repo_name = repository.split("/")
57
+ pages_url = f"https://{org}.github.io"
58
+ if repo_name != f"{org}.github.io":
59
+ # Only add the repo name if it isn't the source for the org pages site
60
+ pages_url += f"/{repo_name}"
61
+ struct = [
62
+ {"version": version, "url": f"{pages_url}/{version}/"} for version in versions
63
+ ]
64
+ text = json.dumps(struct, indent=2)
65
+ print(f"JSON switcher:\n{text}")
66
+ path.write_text(text, encoding="utf-8")
67
+
68
+
69
+ def main(args=None):
70
+ parser = ArgumentParser(
71
+ description="Make a versions.json file from gh-pages directories"
72
+ )
73
+ parser.add_argument(
74
+ "--add",
75
+ help="Add this directory to the list of existing directories",
76
+ )
77
+ parser.add_argument(
78
+ "repository",
79
+ help="The GitHub org and repository name: ORG/REPO",
80
+ )
81
+ parser.add_argument(
82
+ "output",
83
+ type=Path,
84
+ help="Path of write switcher.json to",
85
+ )
86
+ args = parser.parse_args(args)
87
+
88
+ # Write the versions file
89
+ versions = get_versions("origin/gh-pages", args.add)
90
+ write_json(args.output, args.repository, versions)
91
+
92
+
93
+ if __name__ == "__main__":
94
+ main()
@@ -0,0 +1,27 @@
1
+ on:
2
+ workflow_call:
3
+ outputs:
4
+ branch-pr:
5
+ description: The PR number if the branch is in one
6
+ value: ${{ jobs.pr.outputs.branch-pr }}
7
+
8
+ jobs:
9
+ pr:
10
+ runs-on: "ubuntu-latest"
11
+ outputs:
12
+ branch-pr: ${{ steps.script.outputs.result }}
13
+ steps:
14
+ - uses: actions/github-script@v7
15
+ id: script
16
+ if: github.event_name == 'push'
17
+ with:
18
+ script: |
19
+ const prs = await github.rest.pulls.list({
20
+ owner: context.repo.owner,
21
+ repo: context.repo.repo,
22
+ head: context.repo.owner + ':${{ github.ref_name }}'
23
+ })
24
+ if (prs.data.length) {
25
+ console.log(`::notice ::Skipping CI on branch push as it is already run in PR #${prs.data[0]["number"]}`)
26
+ return prs.data[0]["number"]
27
+ }
@@ -0,0 +1,32 @@
1
+ on:
2
+ workflow_call:
3
+
4
+ jobs:
5
+ build:
6
+ runs-on: "ubuntu-latest"
7
+
8
+ steps:
9
+ - name: Checkout
10
+ uses: actions/checkout@v4
11
+ with:
12
+ # Need this to get version number from last tag
13
+ fetch-depth: 0
14
+
15
+ - name: Build sdist and wheel
16
+ run: >
17
+ export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) &&
18
+ pipx run build
19
+
20
+ - name: Upload sdist and wheel as artifacts
21
+ uses: actions/upload-artifact@v4
22
+ with:
23
+ name: dist
24
+ path: dist
25
+
26
+ - name: Check for packaging errors
27
+ run: pipx run twine check --strict dist/*
28
+
29
+ - name: Install produced wheel
30
+ uses: ./.github/actions/install_requirements
31
+ with:
32
+ pip-install: dist/*.whl
@@ -0,0 +1,32 @@
1
+ on:
2
+ workflow_call:
3
+
4
+ jobs:
5
+ artifacts:
6
+ runs-on: ubuntu-latest
7
+
8
+ steps:
9
+ - name: Download artifacts
10
+ uses: actions/download-artifact@v4
11
+ with:
12
+ merge-multiple: true
13
+
14
+ - name: Zip up docs
15
+ run: |
16
+ set -vxeuo pipefail
17
+ if [ -d html ]; then
18
+ mv html $GITHUB_REF_NAME
19
+ zip -r docs.zip $GITHUB_REF_NAME
20
+ rm -rf $GITHUB_REF_NAME
21
+ fi
22
+
23
+ - name: Create GitHub Release
24
+ # We pin to the SHA, not the tag, for security reasons.
25
+ # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
26
+ uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
27
+ with:
28
+ prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
29
+ files: "*"
30
+ generate_release_notes: true
31
+ env:
32
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,62 @@
1
+ on:
2
+ workflow_call:
3
+ inputs:
4
+ python-version:
5
+ type: string
6
+ description: The version of python to install
7
+ required: true
8
+ runs-on:
9
+ type: string
10
+ description: The runner to run this job on
11
+ required: true
12
+ secrets:
13
+ CODECOV_TOKEN:
14
+ required: true
15
+
16
+ env:
17
+ # https://github.com/pytest-dev/pytest/issues/2042
18
+ PY_IGNORE_IMPORTMISMATCH: "1"
19
+
20
+ jobs:
21
+ run:
22
+ runs-on: ${{ inputs.runs-on }}
23
+
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v4
27
+ with:
28
+ # Need this to get version number from last tag
29
+ fetch-depth: 0
30
+
31
+ - if: inputs.python-version == 'dev'
32
+ name: Install dev versions of python packages
33
+ uses: ./.github/actions/install_requirements
34
+
35
+ - if: inputs.python-version == 'dev'
36
+ name: Write the requirements as an artifact
37
+ run: pip freeze --exclude-editable > /tmp/dev-requirements.txt
38
+
39
+ - if: inputs.python-version == 'dev'
40
+ name: Upload dev-requirements.txt
41
+ uses: actions/upload-artifact@v4
42
+ with:
43
+ name: dev-requirements
44
+ path: /tmp/dev-requirements.txt
45
+
46
+ - if: inputs.python-version != 'dev'
47
+ name: Install latest versions of python packages
48
+ uses: ./.github/actions/install_requirements
49
+ with:
50
+ python-version: ${{ inputs.python-version }}
51
+ pip-install: ".[dev]"
52
+
53
+ - name: Run tests
54
+ run: tox -e tests
55
+
56
+ - name: Upload coverage to Codecov
57
+ uses: codecov/codecov-action@v4
58
+ with:
59
+ name: ${{ inputs.python-version }}/${{ inputs.runs-on }}
60
+ files: cov.xml
61
+ env:
62
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,22 @@
1
+ on:
2
+ workflow_call:
3
+ inputs:
4
+ tox:
5
+ type: string
6
+ description: What to run under tox
7
+ required: true
8
+
9
+
10
+ jobs:
11
+ run:
12
+ runs-on: "ubuntu-latest"
13
+
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Install python packages
19
+ uses: ./.github/actions/install_requirements
20
+
21
+ - name: Run tox
22
+ run: tox -e ${{ inputs.tox }}
@@ -0,0 +1,73 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ permissions:
8
+ contents: read
9
+ id-token: write
10
+
11
+ jobs:
12
+ check:
13
+ uses: ./.github/workflows/_check.yml
14
+
15
+ lint:
16
+ needs: check
17
+ if: needs.check.outputs.branch-pr == ''
18
+ uses: ./.github/workflows/_tox.yml
19
+ with:
20
+ tox: pre-commit,type-checking
21
+
22
+ test:
23
+ needs: check
24
+ if: needs.check.outputs.branch-pr == ''
25
+ strategy:
26
+ matrix:
27
+ runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
28
+ python-version: ["3.10", "3.11", "3.12"]
29
+ include:
30
+ # Include one that runs in the dev environment
31
+ - runs-on: "ubuntu-latest"
32
+ python-version: "dev"
33
+ fail-fast: false
34
+ uses: ./.github/workflows/_test.yml
35
+ with:
36
+ runs-on: ${{ matrix.runs-on }}
37
+ python-version: ${{ matrix.python-version }}
38
+ secrets:
39
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
40
+
41
+ dist:
42
+ needs: check
43
+ if: needs.check.outputs.branch-pr == ''
44
+ uses: ./.github/workflows/_dist.yml
45
+
46
+ release:
47
+ if: github.ref_type == 'tag'
48
+ needs: [dist]
49
+ uses: ./.github/workflows/_release.yml
50
+ permissions:
51
+ contents: write
52
+
53
+ publish-to-pypi:
54
+ if: github.ref_type == 'tag'
55
+ needs: [dist]
56
+ runs-on: ubuntu-latest
57
+
58
+ environment:
59
+ name: pypi
60
+ url: https://pypi.org/p/cryoemmonitor
61
+ permissions:
62
+ id-token: write
63
+
64
+ steps:
65
+ - name: Download all the dists
66
+ uses: actions/download-artifact@v5
67
+ with:
68
+ name: dist
69
+ path: dist
70
+ - name: Publish distribution to PyPI
71
+ uses: pypa/gh-action-pypi-publish@release/v1
72
+ with:
73
+ verbose: true
@@ -0,0 +1,73 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+
5
+ # Data
6
+ health_monitor_Krios4
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ env/
13
+ build/
14
+ develop-eggs/
15
+ dist/
16
+ downloads/
17
+ eggs/
18
+ .eggs/
19
+ lib/
20
+ lib64/
21
+ parts/
22
+ sdist/
23
+ var/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ **/_version.py
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ nosetests.xml
46
+ coverage.xml
47
+ cov.xml
48
+ .pytest_cache/
49
+ .mypy_cache/
50
+
51
+ # Translations
52
+ *.mo
53
+ *.pot
54
+
55
+ # Django stuff:
56
+ *.log
57
+
58
+ # Sphinx documentation
59
+ docs/_build/
60
+
61
+ # PyBuilder
62
+ target/
63
+
64
+ # likely venv names
65
+ .venv*
66
+ venv*
67
+
68
+ # further build artifacts
69
+ lockfiles/
70
+
71
+ # ruff cache
72
+ .ruff_cache/
73
+ cryoem-monitor.code-workspace
@@ -0,0 +1,39 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0
4
+ hooks:
5
+ - id: check-added-large-files
6
+ - id: check-yaml
7
+ - id: check-merge-conflict
8
+
9
+ - repo: local
10
+ hooks:
11
+ - id: ruff
12
+ name: lint with ruff
13
+ language: system
14
+ entry: ruff check --force-exclude
15
+ types: [python]
16
+ require_serial: true
17
+
18
+ - id: ruff-format
19
+ name: format with ruff
20
+ language: system
21
+ entry: ruff format --force-exclude
22
+ types: [python]
23
+ require_serial: true
24
+
25
+ # Type checking
26
+ - repo: https://github.com/pre-commit/mirrors-mypy
27
+ rev: v1.9.0 # Released 2024-03-09
28
+ hooks:
29
+ - id: mypy
30
+ name: Checking types in Python scripts using MyPy
31
+ files: '(src|tests)/.*\.py$' # RegEx string showing directories and files to check
32
+ # Single quote critical due to escape character '\' used in the search string
33
+ # (see YAML specifications - 7.3 Flow Scalar Styles)
34
+
35
+ additional_dependencies: [
36
+ # Install missing stub packages
37
+ types-requests,
38
+ types-PyYAML,
39
+ ]
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "ms-vscode-remote.remote-containers",
4
+ ]
5
+ }