Skip to content

Commit

Permalink
upgrade pyaction to 0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lnxpy committed Nov 21, 2024
1 parent a34b822 commit abd74bd
Show file tree
Hide file tree
Showing 6 changed files with 254 additions and 70 deletions.
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Set the base image to the minimal Python 3.12 slim image
# Setting the base-image
FROM python:3.12-slim

# Copy only the necessary binaries from uv
COPY --from=ghcr.io/astral-sh/uv:0.5.1 /uv /uvx /bin/

# Set environment variable early to take advantage of layer caching
ENV UV_PROJECT_ENVIRONMENT="/usr/local/"

# Set the working directory to /action
WORKDIR /action

# importing the action
# Import the action
COPY . .

# running the script.sh
RUN if [ -f script.sh ]; then sh script.sh; fi
# Run the pre-script.sh
RUN [ -f pre-script.sh ] && sh pre-script.sh || true

# Install action dependencies
RUN uv sync --no-install-project --no-cache

# Install project dependencies first for better caching
RUN uv sync --frozen --no-cache
# running the post-script.sh
RUN [ -f post-script.sh ] && sh post-script.sh || true

# Specify the command to run main.py with uv
CMD [ "uv", "run", "main.py" ]
CMD [ "uv", "run", "/action/main.py" ]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: actions/checkout@v4

- name: Updating the badge
uses: lnxpy/pypi-chart-badge@v1.1
uses: lnxpy/pypi-chart-badge@v1.2
with:
package_name: '<PACKAGE-NAME>'

Expand Down
1 change: 1 addition & 0 deletions chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path

from pyaction import PyAction
from pyaction.workflow import annotations as AN
from pyaction.workflow import annotations as A

from chart import Badge
from pypi import PyPI
Expand All @@ -21,13 +21,13 @@ def get_or_create_path(path: str) -> str:
"""

if not os.path.exists(path):
AN.warning(f"Couldn't find `{path}` path in the repo. Creating it!")
A.warning(f"Couldn't find `{path}` path in the repo. Creating it!")
os.makedirs(path)

return path


@workflow.action()
@workflow.action
def action(
package_name: str,
badge_width: int,
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[project]
name = "pypi-chart-badge"
version = "1.1.0"
version = "1.2.0"
description = "PyPI Chart Badge Generator"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"kaleido==0.2.1",
"pandas==2.2.1",
"plotly==5.24.1",
"pyaction==0.7.2",
"pyaction==0.8.1",
"requests==2.32.3",
]

[project.optional-dependencies]
cli = ["pyaction[cli]==0.8.1"]
Loading

0 comments on commit abd74bd

Please sign in to comment.