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
49 changes: 49 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package To PyPi

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: release
permissions:
id-token: write

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # required for setuptools-scm

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

- name: Install the project
run: uv sync --dev

- name: Build package
run: uv build

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist

- name: Publish
if: github.event_name == 'release'
run: uv publish --trusted-publishing always
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
__pycache__
demo/remote/*
# Python-generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info

# Virtual environments
.venv

# IDE
.idea/
.vscode/
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
default_install_hook_types: [pre-commit]
default_language_version:
python: python3.10

repos:
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.13
hooks:
- id: uv-lock

- repo: local
hooks:
- id: uv-ruff-check
name: ruff lint & fix
entry: uv
args: ["run", "ruff", "check", "--fix"]
language: system
types_or: [python, pyi, jupyter]

- id: uv-ruff-format
name: ruff format
entry: uv
args: ["run", "ruff", "format"]
language: system
types_or: [python, pyi, jupyter]

2 changes: 2 additions & 0 deletions Manifest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include LICENSE.md
include README.md
17 changes: 14 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools>=68.0.0", "setuptools-scm>=7.1.0"]
build-backend = "setuptools.build_meta"

[project]
name = "ymodem"
version = "1.5"

description = "Ymodem Python implementation"

Expand All @@ -30,8 +29,11 @@ classifiers = [
]
dependencies = [
"ordered-set>=4.1.0",
"pyserial"
"pyserial>=3.5",
"importlib-metadata >= 4.0; python_version < '3.8'",
]
dynamic = ["version"]


[project.urls]
"Homepage" = "https://github.com/alexwoo1900/ymodem"
Expand All @@ -44,5 +46,14 @@ dependencies = [
[tool.setuptools]
packages = ["ymodem"]

[tool.setuptools_scm]
fallback_version = "0.0.0.dev0"

[dependency-groups]
dev = [
"mypy>=1.4.1",
"pre-commit>=2.21.0",
]

[project.scripts]
ymodem = "ymodem.__main__:main"
947 changes: 947 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

Loading