mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-12 19:30:30 +02:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 10eaa2c0e0 | |||
| b549fd941c | |||
| 2f4e3e7dba | |||
| 38d9a0c177 | |||
| f4c9b7b6b6 | |||
| 5b3389e939 | |||
| 7eabeb3e04 | |||
| 51d4e7e6b8 | |||
| 3fc6ae51c3 | |||
| 525af5b34d |
@@ -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 }}
|
||||
29
.github/workflows/publish.yml
vendored
29
.github/workflows/publish.yml
vendored
@@ -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 }}
|
||||
@@ -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:
|
||||
|
||||
@@ -23,3 +23,5 @@ twine==5.0.0
|
||||
urllib3==2.2.1
|
||||
wheel==0.43.0
|
||||
zipp==3.18.1
|
||||
|
||||
-r requirements.txt
|
||||
|
||||
2
setup.py
2
setup.py
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user