Skip to content

Commit

Permalink
Let's go
Browse files Browse the repository at this point in the history
  • Loading branch information
vuilleumierc committed Aug 21, 2024
1 parent 5ac2f7b commit 9f9a1a3
Show file tree
Hide file tree
Showing 16 changed files with 1,962 additions and 0 deletions.
Empty file added .github/spell-ignore-words.txt
Empty file.
42 changes: 42 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Continuous integration

on:
push:

env:
HAS_SECRETS: ${{ secrets.HAS_SECRETS }}

jobs:
build:
name: Continuous integration
runs-on: ubuntu-22.04
timeout-minutes: 15
if: "!startsWith(github.event.head_commit.message, '[skip ci] ')"

steps:
- uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: pypi docker
if: env.HAS_SECRETS == 'HAS_SECRETS'

- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --requirement=ci/requirements.txt

- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-"
- run: pre-commit run --all-files
env:
SKIP: poetry-lock,isort
- run: git diff && false
if: failure()

- name: Install
run: make install

- name: Tests
run: make tests
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ignore all python cache files recursively
**/__pycache__/
/.pytest_cache/
/.venv/
92 changes: 92 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
additional_dependencies:
- [email protected]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: detect-private-key
- id: check-merge-conflict
- id: check-ast
- id: debug-statements
- id: check-toml
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
exclude: |-
(?x)(
(.*/)?poetry\.lock
|.github/changelog-generator-cache/.*
)
args:
- --ignore-words=.github/spell-ignore-words.txt
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.5
hooks:
- id: check-github-actions
- id: check-github-workflows
- id: check-jsonschema
name: Check GitHub Workflows set timeout-minutes
files: ^\.github/workflows/[^/]+$
types:
- yaml
args:
- --builtin-schema
- github-workflows-require-timeout
- id: check-renovate
additional_dependencies:
- pyjson5==1.6.6 # pypi
- repo: https://github.com/sirwart/ripsecrets
rev: v0.1.8
hooks:
- id: ripsecrets
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
hooks:
- id: pyupgrade
args:
- --py39-plus
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args:
[
--profile,
"black",
--filter-files,
--line-length,
"110",
--skip-gitignore,
--multi-line,
"3",
--split-on-trailing-comma,
]
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
ci:
autoupdate_schedule: quarterly
skip:
- copyright
- ripsecrets
- jsonschema-validator
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2024, Camptocamp SA
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.PHONY: help
help: ## Display this help message
@echo "Usage: make <target>"
@echo
@echo "Available targets:"
@grep --extended-regexp --no-filename '^[a-zA-Z_-]+:.*## ' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s%s\n", $$1, $$2}'

.PHONY: install
install: ## Install package
poetry install

.PHONY: tests
tests: ## Run unit tests
pytest -vvv tests
7 changes: 7 additions & 0 deletions ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
c2cciutils[publish]==1.6.22
poetry-dynamic-versioning[plugin]==1.4.0
pre-commit==3.8.0
pytest==8.3.2
poetry-plugin-tweak-dependencies-version==1.5.2
poetry-dynamic-versioning==1.4.0
poetry-plugin-drop-python-upper-constraint==0.1.0
3 changes: 3 additions & 0 deletions geoservercloud/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .geoservercloud import GeoServerCloud

__all__: list[str] = ["GeoServerCloud"]
Loading

0 comments on commit 9f9a1a3

Please sign in to comment.