From 0e139c9b9c6d6528fe29604970cb95416f7e79ca Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Tue, 19 Mar 2024 20:55:30 +0000 Subject: [PATCH] update to copier 2.0.2 and switch from container to pypi --- .copier-answers.yml | 4 +-- .github/workflows/_container.yml | 56 -------------------------------- .github/workflows/ci.yml | 7 ---- Dockerfile | 6 ++++ README.md | 1 - pyproject.toml | 10 +++--- 6 files changed, 13 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/_container.yml diff --git a/.copier-answers.yml b/.copier-answers.yml index acd3c27..7cbc6b2 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -7,11 +7,11 @@ component_owner: group:default/sscc description: Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs distribution_name: rtems-proxy -docker: true +docker: false docs_type: README git_platform: github.com github_org: epics-containers package_name: rtems_proxy pypi: true repo_name: rtems-proxy -type_checker: pyright +type_checker: mypy diff --git a/.github/workflows/_container.yml b/.github/workflows/_container.yml deleted file mode 100644 index 4857ee9..0000000 --- a/.github/workflows/_container.yml +++ /dev/null @@ -1,56 +0,0 @@ -on: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to GitHub Docker Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and export to Docker local cache - uses: docker/build-push-action@v5 - with: - context: . - # Need load and tags so we can test it below - load: true - tags: tag_for_testing - - - name: Test cli works in cached runtime image - run: docker run --rm tag_for_testing --version - - - name: Create tags for publishing image - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/${{ github.repository }} - tags: | - type=ref,event=tag - type=raw,value=latest - - - name: Push cached image to container registry - if: github.ref_type == 'tag' - uses: docker/build-push-action@v5 - # This does not build the image again, it will find the image in the - # Docker cache and publish it - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86d449c..71cc4a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,13 +34,6 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - container: - needs: check - if: needs.check.outputs.branch-pr == '' - uses: ./.github/workflows/_container.yml - permissions: - packages: write - dist: needs: check if: needs.check.outputs.branch-pr == '' diff --git a/Dockerfile b/Dockerfile index ab68861..1bc8e1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ ARG PYTHON_VERSION=3.12 +<<<<<<< before updating ##### developer stage ########################################################## FROM python:${PYTHON_VERSION} as developer @@ -40,3 +41,8 @@ COPY proxy-start.sh /proxy-start.sh ENTRYPOINT ["rtems-proxy"] CMD ["--version"] +======= +# Set up a virtual environment and put it in PATH +RUN python -m venv /venv +ENV PATH=/venv/bin:$PATH +>>>>>>> after updating diff --git a/README.md b/README.md index 364c99e..14a6003 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ how it does it, and why people should use it. Source | :---: | :---: PyPI | `pip install rtems-proxy` -Docker | `docker run ghcr.io/epics-containers/rtems-proxy:latest` Releases | This is where you should put some images or code snippets that illustrate diff --git a/pyproject.toml b/pyproject.toml index 469f720..c2b8796 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,9 +23,9 @@ requires-python = ">=3.7" [project.optional-dependencies] dev = [ "copier", + "mypy", "pipdeptree", "pre-commit", - "pyright", "pytest", "pytest-cov", "ruff", @@ -47,8 +47,8 @@ name = "Giles Knap" [tool.setuptools_scm] write_to = "src/rtems_proxy/_version.py" -[tool.pyright] -reportMissingImports = false # Ignore missing stubs in imported modules +[tool.mypy] +ignore_missing_imports = true # Ignore missing stubs in imported modules [tool.pytest.ini_options] # Run pytest with all our checkers, and don't spam us with massive tracebacks on error @@ -81,10 +81,10 @@ passenv = * allowlist_externals = pytest pre-commit - pyright + mypy commands = pre-commit: pre-commit run --all-files {posargs} - type-checking: pyright src tests {posargs} + type-checking: mypy src tests {posargs} tests: pytest --cov=rtems_proxy --cov-report term --cov-report xml:cov.xml {posargs} """