Skip to content
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

First implementation #1

Merged
merged 8 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.0
current_version = 0.2.0
commit = False
tag = False

Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
strategy:
matrix:
python-version: ["3.11"] # , "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Do pre-commit checks (black, lint, mypy)
run: |
poetry run docker/pre_commit_init.sh
- name: Test with pytest
run: |
poetry run py.test -v --junitxml=pytest.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/pytest*.xml'
detailed_summary: true
check_name: 'JUnit report (local)'

devel_shell:
runs-on: ubuntu-latest
steps:
- uses: pvarki/ci@main
with:
dockerfile-target: devel_shell
image-tag: rmcli:devel_shell

production:
runs-on: ubuntu-latest
steps:
- uses: pvarki/ci@main
with:
dockerfile-target: production
image-tag: rmcli:production
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# IDE settings
.idea

# certs
*.crt
*.key
*.pem

# other artfacts like client-zips
*.zip


# ci artefacts
pytest*.xml

Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3
python: python3.11
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: no-commit-to-branch
- id: check-executables-have-shebangs
Expand All @@ -22,29 +22,29 @@ repos:
args:
- --autofix
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.7.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v1.5.1
hooks:
- id: mypy
language: system
- repo: https://github.com/pycqa/pylint
rev: v2.13.4
rev: v2.17.5
hooks:
- id: pylint
language: system
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.13
rev: v1.5.0
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
- id: remove-tabs
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
rev: 1.7.5
hooks:
- id: bandit
args: ["--skip=B101"]
Expand All @@ -53,9 +53,9 @@ repos:
hooks:
- id: rst-linter
- repo: https://github.com/Yelp/detect-secrets
rev: v1.2.0
rev: v1.4.0
hooks:
- id: detect-secrets
language: system
exclude: "poetry.lock"
exclude: "poetry\\.lock|tests/data/.*"
# args: ['--baseline', '.secrets.baseline']
1 change: 1 addition & 0 deletions Dockerfile_alpine
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ WORKDIR /app
# Install system level deps for running the package (not devel versions for building wheels)
# and install the wheels we built in the previous step. generate default config
RUN --mount=type=ssh apk add --no-cache \
git \
bash \
tini \
&& chmod a+x /docker-entrypoint.sh \
Expand Down
1 change: 1 addition & 0 deletions Dockerfile_debian
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ WORKDIR /app
# and install the wheels we built in the previous step. generate default config
RUN --mount=type=ssh apt-get update && apt-get install -y \
bash \
git \
tini \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
Expand Down
8 changes: 5 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
rmcli
=====

CLI interface to RASENMAEHER API
CLI interface to RASENMAEHER API.

See the cli built-in help for details


Docker
Expand Down Expand Up @@ -70,15 +72,15 @@ There's a "production" target as well for running the application, remember to c
architecture tag to arm64 if building on ARM::

docker build --ssh default --target production -t rmcli:amd64-latest .
docker run -it --name rmcli rmcli:amd64-latest
docker run -it --rm -v `pwd`:/workdir --name rmcli rmcli:amd64-latest

Development
-----------
TODO: Remove the repo init from this document after you have done it.

TLDR:

- Create and activate a Python 3.8 virtualenv (assuming virtualenvwrapper)::
- Create and activate a Python 3.11 virtualenv (assuming virtualenvwrapper)::

mkvirtualenv -p `which python3.11` my_virtualenv

Expand Down
Loading