migrated to uv and cleaned up workflows
Some checks failed
Actions / Build (push) Successful in 10s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 13s
Actions / Build Documentation (MkDocs) (push) Failing after 15s

This commit is contained in:
Seaswimmer 2024-10-21 16:38:14 -04:00
parent 155389b6b6
commit 8904a13fa1
Signed by: cswimr
GPG key ID: A9C162E867C851FA
6 changed files with 1779 additions and 2121 deletions

View file

@ -1,58 +0,0 @@
name: Autotagger
on:
push:
branches:
- 'main'
jobs:
Autotagger:
runs-on: docker
container: catthehacker/ubuntu:act-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Git
run: |
git config --global user.name "SeaswimmerTheFsh"
git config --global user.email "seaswimmerthefsh@gmail.com"
- name: Import GPG key
uses: actions/gpg@v4
with:
gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
passphrase : ${{ secrets.GPG_PASSPHRASE }}
- name: Set output variables
id: vars
run: |
git fetch --tags
echo "::set-output name=latest_tag::$(git describe --tags `git rev-list --tags --max-count=1`)"
echo "::set-output name=version::$(awk -F '=' '/^ *version/ {gsub(/[[:space:]"]/, "", $2); print $2}' pyproject.toml)"
- name: Compare version and latest tag
id: compare
run: |
VERSION=${{ steps.vars.outputs.version }}
LATEST_TAG=${{ steps.vars.outputs.latest_tag }}
if [ "$VERSION" = "$LATEST_TAG" ]; then
echo "::set-output name=latest_tag::$LATEST_TAG"
else
echo "::set-output name=version::$VERSION"
fi
- name: Create tag
if: steps.compare.outputs.version
run: |
VERSION=${{ steps.vars.outputs.version }}
git tag -s $VERSION -m "version bumped to $VERSION"
git push origin $VERSION
- name: Update latest tag
if: steps.compare.outputs.latest_tag
run: |
LATEST_TAG=${{ steps.compare.outputs.latest_tag }}
git tag -fs $LATEST_TAG -m $LATEST_TAG
git push origin $LATEST_TAG --force

View file

@ -1,38 +1,86 @@
name: Actions name: Actions
on: on:
push: push:
branches:
- 'main'
pull_request: pull_request:
jobs: jobs:
Lint Code (Ruff & Pylint): build:
name: Build
runs-on: docker runs-on: docker
container: coastalcommits.com/seaswimmerthefsh/actionscontainers-pyzipline:latest container: www.coastalcommits.com/cswimr/actions:uv
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Install dependencies
run: poetry install --with dev --no-root
- name: Analysing code with Ruff
run: ruff check $(git ls-files '*.py')
- name: Analysing code with Pylint
run: pylint --rcfile .forgejo/workflows/config/.pylintrc $(git ls-files '*.py')
Build Documentation (MkDocs):
runs-on: docker
container: coastalcommits.com/seaswimmerthefsh/actionscontainers-pyzipline:latest
steps:
- name: Checkout
uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install python
run: uv python install 3.11
- name: Install dependencies - name: Install dependencies
run: poetry install --with docs --no-root run: uv sync --no-dev
- name: Build the package
run: uv build
- name: Upload the package
uses: actions/upload-artifact@v3
with:
name: pyflowery
path: ./dist/*
- name: Publish to CoastalCommits
if: startsWith(github.ref, 'refs/tags/')
uses: actions/pypi-publish@v1.8.14
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.COASTALCOMMITSTOKEN }}
repository_url: https://www.coastalcommits.com/api/packages/${{ github.repository_owner }}/pypi
# do not publish to pypi until the package is stable
# - name: Publish to PyPi
# if: startsWith(github.ref, 'refs/tags/')
# uses: actions/pypi-publish@v1.8.14
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
lint:
name: Lint Code (Ruff & Pylint)
runs-on: docker
container: coastalcommits.com/cswimr/actions:uv
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install python
run: uv python install 3.11
- name: Install dependencies
run: uv sync
- name: Analysing code with Ruff
run: uv run ruff check $(git ls-files '*.py')
- name: Analysing code with Pylint
run: uv run pylint --rcfile .forgejo/workflows/config/.pylintrc $(git ls-files '*.py')
docs:
name: Build Documentation (MkDocs)
runs-on: docker
container: coastalcommits.com/cswimr/actions:docs
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install python
run: uv python install 3.11
- name: Install dependencies
run: uv sync --extra docs
- name: Set environment variables - name: Set environment variables
uses: actions/env@v2 uses: actions/env@v2
@ -41,7 +89,7 @@ jobs:
run: | run: |
export SITE_URL="https://$CI_ACTION_REF_NAME_SLUG.pyzipline.coastalcommits.com" export SITE_URL="https://$CI_ACTION_REF_NAME_SLUG.pyzipline.coastalcommits.com"
export EDIT_URI="src/branch/$CI_ACTION_REF_NAME/docs" export EDIT_URI="src/branch/$CI_ACTION_REF_NAME/docs"
mkdocs build -v uv run mkdocs build -v
- name: Deploy documentation - name: Deploy documentation
run: | run: |
@ -57,7 +105,7 @@ jobs:
npx -p "@getmeli/cli" meli upload ./site \ npx -p "@getmeli/cli" meli upload ./site \
--url "https://pages.coastalcommits.com" \ --url "https://pages.coastalcommits.com" \
--site "${{ vars.MELI_SITE_ID }}" \ --site "${{ vars.MELI_SITE_ID }}" \
--token "${{ secrets.MELI_SECRET }}" \ --token "${{ secrets.MELI_TOKEN }}" \
--release "$CI_ACTION_REF_NAME_SLUG/${{ env.GITHUB_SHA }}" \ --release "$CI_ACTION_REF_NAME_SLUG/${{ env.GITHUB_SHA }}" \
--branch "$CI_ACTION_REF_NAME_SLUG" --branch "$CI_ACTION_REF_NAME_SLUG"

2
.gitignore vendored
View file

@ -2,3 +2,5 @@ __pycache__
.cache .cache
.zipline .zipline
dev.py dev.py
dist/
pyzipline.egg-info/

2008
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,37 +1,31 @@
[tool.poetry] [project]
name = "pyzipline" name = "pyzipline"
version = "0.1.0" version = "0.1.0"
description = "Python API Wrapper for the Zipline API" description = "Python API Wrapper for the Zipline API"
authors = ["SeaswimmerTheFsh <seaswimmerthefsh@gmail.com>"] authors = [{name="cswimr", email="seaswimmerthefsh@gmail.com"}]
license = "GNU GPLv3" license = {file="LICENSE"}
readme = "README.md" readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"aiohttp>=3.10.10",
"asyncio>=3.4.3",
"pydantic>=2.9.2",
"requests>=2.32.3",
]
[tool.poetry.dependencies] [project.optional-dependencies]
python = "^3.10 || ^3.11 || ^3.12" docs = [
requests = "^2.31.0" "mkdocs>=1.6.1",
asyncio = "^3.4.3" "mkdocs-git-authors-plugin>=0.9.0",
aiohttp = "^3.9.1" "mkdocstrings[python]>=0.26.2",
pydantic = "^2.6.4" "mkdocs-git-revision-date-localized-plugin>=1.2.9",
"mkdocs-material[imaging]>=9.5.42",
"mkdocs-redirects>=1.2.1",
]
[tool.poetry.group.dev] [tool.uv]
optional = true dev-dependencies = [
"datamodel-code-generator>=0.26.2",
[tool.poetry.group.dev.dependencies] "pylint>=3.3.1",
pylint = "^3.0.3" "ruff>=0.7.0",
ruff = "^0.3.4" ]
datamodel-code-generator = "^0.25.5"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
mkdocs = "1.5.3"
mkdocstrings = {extras = ["python"], version = "0.24.0"}
mkdocs-git-authors-plugin = "0.7.2"
mkdocs-git-revision-date-localized-plugin = "1.2.2"
mkdocs-material = {extras = ["imaging"], version = "^9.5.2"}
mkdocs-redirects = "^1.2.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

1680
uv.lock Normal file

File diff suppressed because it is too large Load diff