-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from niro1987:v2
V2
- Loading branch information
Showing
53 changed files
with
4,021 additions
and
6,489 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,13 @@ | ||
FROM mcr.microsoft.com/devcontainers/python:1-3.12 | ||
|
||
# Uninstall pre-installed formatting and linting tools | ||
# They would conflict with our pinned versions | ||
RUN pipx uninstall pydocstyle \ | ||
&& pipx uninstall pycodestyle \ | ||
&& pipx uninstall mypy \ | ||
&& pipx uninstall pylint | ||
|
||
# Install Python dependencies from requirements | ||
WORKDIR /usr/src | ||
COPY . . | ||
RUN pip install -r requirements.txt -r .devcontainer/requirements-dev.txt |
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,46 @@ | ||
{ | ||
"name": "Python Package Devcontainer", | ||
"build": { | ||
"context": "..", | ||
"dockerfile": "./Dockerfile" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.defaultInterpreterPath": "/usr/local/bin/python", | ||
"python.testing.pytestEnabled": false, | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestArgs": ["--no-cov"], | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": true, | ||
"files.trimTrailingWhitespace": true, | ||
"terminal.integrated.profiles.linux": { | ||
"zsh": { | ||
"path": "/usr/bin/zsh" | ||
} | ||
}, | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
"[python]": { | ||
"editor.defaultFormatter": "charliermarsh.ruff" | ||
} | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"visualstudioexptteam.vscodeintellicode", | ||
"charliermarsh.ruff", | ||
"ms-python.pylint", | ||
"matangover.mypy", | ||
"redhat.vscode-yaml", | ||
"esbenp.prettier-vscode", | ||
"GitHub.vscode-pull-request-github", | ||
"eamodio.gitlens", | ||
"tamasfe.even-better-toml", | ||
"github.vscode-github-actions" | ||
] | ||
} | ||
}, | ||
"postCreateCommand": "git config --global --add safe.directory /workspaces/python-sapcommissions && pre-commit install --install-hooks", | ||
"postStartCommand": "pip install -e ." | ||
} |
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,22 @@ | ||
# Use this file to list development requirements for your project. | ||
|
||
# build | ||
setuptools>=61.0 | ||
setuptools_scm>=6.2 | ||
|
||
# pre-commit | ||
pre-commit==3.7.0 | ||
ruff==0.3.5 | ||
codespell==2.2.6 | ||
yamllint==1.35.1 | ||
|
||
# dev | ||
pylint==3.1.0 | ||
mypy==1.9.0 | ||
|
||
# test | ||
coverage==7.4.4 | ||
pytest==8.1.1 | ||
pytest-cov==5.0.0 | ||
pytest-asyncio==0.23.6 | ||
aioresponses>=0.7.6 |
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,2 @@ | ||
* text eol=lf | ||
*.py whitespace=error |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,35 +1,81 @@ | ||
name: Publish to PyPI.org | ||
--- | ||
# This workflow will upload a Python Package using Twine | ||
# when a release is created. For more information see: | ||
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
|
||
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
pypi: | ||
build: | ||
name: Build distribution 📦 | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') # only publish on tag pushes | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
fetch-depth: 0 | ||
python-version: "3.11" | ||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python3 -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
- name: Publish distribution 📦 to Test PyPI | ||
run: python3 -m build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish-to-testpypi: | ||
name: Publish Python 🐍 distribution 📦 to TestPyPI | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/python-sapcommissions | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
publish-to-pypi: | ||
name: >- | ||
Publish Python 🐍 distribution 📦 to PyPI | ||
needs: | ||
- publish-to-testpypi | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/python-sapcommissions | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -3,4 +3,6 @@ __pycache__/ | |
.venv/ | ||
dist/ | ||
build/ | ||
main.py | ||
.env | ||
*.log | ||
tests/deploy/ |
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
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,10 @@ | ||
[distutils] | ||
index-servers = | ||
pypi | ||
testpypi | ||
|
||
[pypi] | ||
repository = https://upload.pypi.org/legacy/ | ||
|
||
[testpypi] | ||
repository = https://test.pypi.org/legacy/ |
Oops, something went wrong.