Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,26 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup Python
uses: automas-dev/reusable-workflows/setup_python@main
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
poetry-version: "1.8.5"
python-version-file: .python-version

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install Dependencies
run: poetry install
run: uv sync --locked --all-extras --dev

- name: Lint
run: poetry run ruff check .
run: |
uv run ruff format --check
uv run ruff check

# - name: Test
# run: poetry run pytest tests --cov=src --cov-branch --cov-fail-under=100
# run: uv run pytest

build_release:
name: Build Release
Expand All @@ -45,30 +49,30 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Increment Version
uses: automas-dev/reusable-workflows/increment_version@main
uses: automas-dev/reusable-workflows/increment_version@v1.0
id: version

- name: Setup Python
uses: automas-dev/reusable-workflows/setup_python@main
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
poetry-version: "1.8.5"
python-version-file: .python-version

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install Dependencies
run: poetry install
run: uv sync --locked --all-extras --dev

- name: Set version
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
poetry version $VERSION
run: uv version $VERSION

- name: Build Release
run: |
poetry build
run: uv build

- name: Create Release
uses: ncipollo/release-action@v1.14.0
Expand All @@ -80,7 +84,5 @@ jobs:

- name: Publish Package
env:
PYPI_TOKEN: ${{ secrets.PYPI_KEY }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_KEY }}
run: uv publish
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@

setup:
poetry install
uv sync

build: setup
poetry build
uv build

install: build
/usr/bin/python3 -m pip install dist/$$(ls dist | grep .whl | tail -n 1)

checks: lint test

lint:
poetry run ruff check .
uv run ruff format --check
uv run ruff check

format:
poetry run ruff check --fix .
uv run ruff format
uv run ruff check --fix

test:
poetry run pytest tests
uv run pytest

.PHONY: setup build install checks lint format test
386 changes: 0 additions & 386 deletions poetry.lock

This file was deleted.

44 changes: 21 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
[tool.poetry]
[project]
name = "codepic"
version = "0.1.0"
description = "Capture code in a picture"
authors = ["Thomas Harrison <theharrisoncrafter@gmail.com>"]
readme = "README.md"
license = "MIT"
authors = [{ name = "Thomas Harrison", email = "theharrisoncrafter@gmail.com" }]
homepage = "https://github.com/automas-dev/codepic"
repository = "https://github.com/automas-dev/codepic"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: POSIX :: Linux",
"License :: OSI Approved :: MIT License",
]
requires-python = ">=3.11"
dependencies = [
"click>=8.4.0",
"pillow>=12.2.0",
"pygments>=2.20.0",
]

packages = [{ include = "codepic", from = "src" }]

[tool.poetry.dependencies]
python = "^3.10"
pygments = "^2.19.1"
pillow = "^11.1.0"
click = "^8.1.8"
# packages = [{ include = "codepic", from = "src" }]

[tool.poetry.group.dev.dependencies]
pytest = "^7.1.3"
pytest-cov = "^4.0.0"
ruff = "^0.8.4"
[dependency-groups]
dev = [
"pytest>=9.0.3",
"pytest-cov>=7.1.0",
"ruff>=0.15.13",
]

[tool.poetry.scripts]
[project.scripts]
codepic = "codepic:cli"

[build-system]
requires = ["uv_build>=0.11.15,<0.12.0"]
build-backend = "uv_build"

[tool.ruff.lint]
extend-select = ["I"]
ignore = ["F401"]
Expand All @@ -38,19 +43,12 @@ quote-style = "single"

[tool.pytest.ini_options]
pythonpath = ["src"]
addopts = "--cov=src --cov-branch --cov-fail-under=100"
addopts = "--cov"

[tool.coverage.run]
branch = false
source = ["src"]

[tool.coverage.paths]
source = ["src"]

[tool.coverage.report]
show_missing = true
fail_under = 100

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
1 change: 0 additions & 1 deletion src/codepic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from .cli import cli

if __name__ == '__main__':
Expand Down
Loading