Compare commits

...

10 Commits

Author SHA1 Message Date
10eaa2c0e0 Fixed workflow 2024-04-01 20:57:39 +02:00
b549fd941c Added content type for long description 2024-04-01 20:53:02 +02:00
2f4e3e7dba Added long_description 2024-04-01 20:46:27 +02:00
38d9a0c177 Added additional fetching for git checkout 2024-04-01 20:43:11 +02:00
f4c9b7b6b6 Update ci.yml 2024-04-01 20:38:16 +02:00
5b3389e939 Added manual triggering of the action 2024-04-01 20:33:34 +02:00
7eabeb3e04 Moved to tagging without prefix 2024-04-01 20:31:45 +02:00
51d4e7e6b8 Reworked CI 2024-04-01 20:28:16 +02:00
3fc6ae51c3 Added todos 2024-04-01 20:19:43 +02:00
525af5b34d Merged workflows 2024-04-01 20:19:02 +02:00
6 changed files with 40 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
name: Lint and tag
name: Lint, Test, Tag & Publish
on:
push:
@@ -10,6 +10,7 @@ on:
- "**/.vscode/**"
- "**/README.md"
- "**/CHANGELOG.md"
workflow_dispatch:
jobs:
lint:
@@ -39,27 +40,51 @@ jobs:
- run: python -m pip install -r requirements.txt
- run: python test.py
tag:
tag_and_publish:
runs-on: ubuntu-latest
needs: test
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write # for the tags
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
ref: ${{ github.ref }}
fetch-depth: 0
- name: setup git
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Action"
git config --local user.email "15138480+creyD@users.noreply.github.com"
git config --local user.name "creyD"
- name: Git Version
uses: codacy/git-version@2.8.0
id: git_version
with:
prefix: v
minor-identifier: "feat:"
major-identifier: "breaking:"
- name: Create Tag
run: git tag -a ${{ steps.git_version.outputs.version }} -m "${{ steps.git_version.outputs.version }}"
run: git tag ${{ steps.git_version.outputs.version }}
- name: Push Tag
- name: Push tag
run: git push origin ${{ steps.git_version.outputs.version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.build.txt
python setup.py sdist bdist_wheel
- name: Build and publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

View File

@@ -1,29 +0,0 @@
name: Publish to pypi
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.build.txt
- name: Build and publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

View File

@@ -1,2 +1,3 @@
# creyPY
My collection of Python and FastAPI shortcuts etc.

View File

@@ -19,6 +19,7 @@ def get_object_or_404(db_class: Type[T], id: UUID | str, db: Session, expunge: b
return obj
# TODO: Add testing
def create_obj_from_data(
data: BaseModel, model: Type[T], db: Session, additonal_data={}, exclude={}
) -> T:
@@ -29,6 +30,7 @@ def create_obj_from_data(
return obj
# TODO: Add testing
def update_obj_from_data(
data: BaseModel,
model: Type[T],
@@ -50,6 +52,7 @@ def update_obj_from_data(
return obj
# TODO: Add testing
def delete_object(db_class: Type[T], id: UUID | str, db: Session) -> None:
obj = db.query(db_class).filter(db_class.id == id).one_or_none()
if obj is None:

View File

@@ -23,3 +23,5 @@ twine==5.0.0
urllib3==2.2.1
wheel==0.43.0
zipp==3.18.1
-r requirements.txt

View File

@@ -24,6 +24,8 @@ setup(
name="creyPY",
version=get_latest_git_tag(),
description="Collection of my Python and FastAPI shortcuts, snippets etc.",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Conrad Großer",
author_email="conrad@noah.tech",
packages=find_packages(),