-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: bvandekerkhof <[email protected]>
- Loading branch information
0 parents
commit 2163c7a
Showing
89 changed files
with
12,853 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,19 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import re | ||
|
||
with open("pyproject.toml", "r") as file: | ||
version_content = file.read() | ||
# Match regex for <version="0.0.0a",> pattern | ||
old_semantic_version = re.findall(r'version = "(\d+\.\d+\.[a-zA-Z0-9]+)"', version_content) | ||
major_version, minor_version, patch_version = old_semantic_version[0].split(".") | ||
patch_version = int(re.findall(r"\d+", patch_version)[0]) | ||
new_semantic_version = f"{major_version}.{minor_version}.{patch_version + 1}" | ||
regex_bumped_patch_version = f"\g<1>{new_semantic_version}" | ||
# Match regex for <version = "0.0.0a"> pattern | ||
bumped_version_content = re.sub(r'(version = ")\d+\.\d+\.[a-zA-Z0-9]+', regex_bumped_patch_version, version_content) | ||
with open("pyproject.toml", "w") as file: | ||
file.write(bumped_version_content) | ||
print(new_semantic_version) # Print is required for release in GitHub action |
This file contains 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,43 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
# Description | ||
|
||
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. | ||
|
||
Fixes # (issue) | ||
|
||
## Type of change | ||
|
||
Please delete options that are not relevant. | ||
|
||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
- [ ] This change requires a documentation update | ||
|
||
# Jupyter Notebooks | ||
|
||
If your changes involve Jupyter notebooks please explicitly state here what the change consists of, e.g. only output cells have changes or specific input changes. This to make sure we capture these changes correctly in the review process. | ||
|
||
# How Has This Been Tested? | ||
|
||
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration | ||
|
||
- [ ] Test A | ||
- [ ] Test B | ||
|
||
|
||
# Checklist: | ||
|
||
- [ ] My code follows the style guidelines of this project | ||
- [ ] I have performed a self-review of my code | ||
- [ ] I have made corresponding changes to the documentation | ||
- [ ] My changes generate no new warnings | ||
- [ ] I have added tests that prove my fix is effective or that my feature works | ||
- [ ] New and existing unit tests pass locally with my changes | ||
- [ ] Any dependent changes have been merged and published in downstream modules | ||
|
This file contains 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,34 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Building the package | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.11" ] | ||
steps: | ||
- name: Checkout Repo | ||
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 --upgrade build | ||
- name: Build the package | ||
run: | | ||
python -m build | ||
- name: Upload build files | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pyelq_whl | ||
path: ./dist/*.whl |
This file contains 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,42 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Code formatting | ||
on: | ||
- push | ||
jobs: | ||
Black: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# Specify all python versions you might want to perform the actions on | ||
python-version: [ "3.11" ] | ||
steps: | ||
- name: Checkout Repo | ||
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 black | ||
pip install isort | ||
- name: Run isort, docformatter and black checks | ||
run: | | ||
isort . --check | ||
black . --check | ||
- name: Run isort and black when required and commit back | ||
if: failure() | ||
env: | ||
GITHUB_ACCESS_TOKEN: ${{ secrets.PYELQ_TOKEN }} | ||
run: | | ||
isort . | ||
black . | ||
git config --global user.name 'code_reformat' | ||
git config --global user.email '' | ||
git remote set-url origin "https://[email protected]/$GITHUB_REPOSITORY" | ||
git commit --signoff -am "Automatic reformat of code" | ||
git push |
This file contains 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,26 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: publish documentation | ||
on: | ||
push: | ||
branches: | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- uses: actions/cache@v2 | ||
with: | ||
key: ${{ github.ref }} | ||
path: .cache | ||
- run: pip install mkdocs-material | ||
- run: pip install mkdocstrings-python | ||
- run: mkdocs gh-deploy --force |
This file contains 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,28 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: pydocstyle | ||
on: | ||
- push | ||
jobs: | ||
pydocstyle: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# Specify all python versions you might want to perform the actions on | ||
python-version: [ "3.11" ] | ||
steps: | ||
- name: Checkout Repo | ||
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 pydocstyle | ||
- name: Run PydocStyle check | ||
run: | | ||
pydocstyle . |
This file contains 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,37 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
on: | ||
- push | ||
|
||
name: Pylint Check | ||
jobs: | ||
Pylint: | ||
# Specify the operating system GitHub has to use to perform the checks (ubuntu seems to be default) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# Specify all python versions you might want to perform the actions on | ||
python-version: ["3.11"] | ||
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 pylint | ||
pip install . | ||
- name: Analysing the code with pylint | ||
# Run through the src/pyelq/ directory and check all .py files with pylint | ||
run: | | ||
python -m pylint `find -regextype egrep -regex '(.*src/pyelq/.*.py)$'` --output-format=parseable:pylint_report.out | ||
- name: Upload pylint results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pylint_report | ||
path: pylint_report.out | ||
if: ${{ always() }} |
This file contains 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,52 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: ReleaseTag | ||
|
||
# Trigger when a python file is changed on main branch either from pull request or push | ||
# but not when only pyproject.toml is changed due to version bump | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- '**.py' | ||
- '!pyproject.toml' | ||
- 'requirements.txt' | ||
|
||
jobs: | ||
# Releases new Python version when Pull Requests are merged into "main" | ||
Release: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# Specify all python versions you might want to perform the actions on | ||
python-version: [ "3.11" ] | ||
steps: | ||
# Checkout | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Bump version and commit bumped version back to branch | ||
env: | ||
GITHUB_ACCESS_TOKEN: ${{ secrets.PYELQ_TOKEN | ||
id: version | ||
run: | | ||
version=$(python .github/bump_version.py) | ||
git config --global user.name 'bump_version' | ||
git config --global user.email '[email protected]' | ||
git remote set-url origin "https://[email protected]/$GITHUB_REPOSITORY" | ||
git commit --signoff -am "Bumped minor version" | ||
git push | ||
echo "BUMPED_VERSION=$(echo v$version)" >> $GITHUB_ENV | ||
echo "New version: $version" | ||
- name: Create Release | ||
run: gh release create ${{ env.BUMPED_VERSION }} --generate-notes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PYELQ_TOKEN }} |
This file contains 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,17 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: REUSE Compliance Check | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: REUSE Compliance Check | ||
uses: fsfe/reuse-action@v2 |
Oops, something went wrong.