Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hikarilan/ci pypi #2

Merged
merged 14 commits into from
Jul 8, 2024
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Check PR Format and Test for python-markdown-extension

on:
pull_request:
branches:
- master
paths:
- python-markdown-extension/**

jobs:
check-format:
name: Check PR Format
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python-markdown-extension
steps:
- uses: actions/checkout@v4
name: Checkout Repo
- uses: eifinger/setup-rye@v3
name: Setup Rye
with:
enable-cache: true
working-directory: python-markdown-extension
- run: rye sync
name: Install Dependencies
- run: rye fmt --check
name: Check Format
test:
name: Test PR
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python-markdown-extension
steps:
- uses: actions/checkout@v4
name: Checkout Repo
- uses: eifinger/setup-rye@v3
name: Setup Rye
with:
enable-cache: true
working-directory: python-markdown-extension
- run: rye sync
name: Install Dependencies
- run: rye run test
name: Run Tests
27 changes: 27 additions & 0 deletions .github/workflows/publish-python-markdown-extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish python-markdown-extension to Pypi

on:
push:
branches:
- master
paths:
- python-markdown-extension/**

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python-markdown-extension
steps:
- uses: actions/checkout@v4
name: Checkout Repo
- uses: eifinger/setup-rye@v3
name: Setup Rye
with:
enable-cache: true
working-directory: python-markdown-extension
- run: rye sync
name: Install Dependencies
- run: rye publish --yes
36 changes: 0 additions & 36 deletions .gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions index.html

This file was deleted.

15 changes: 0 additions & 15 deletions package.json

This file was deleted.

1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

12 changes: 12 additions & 0 deletions python-markdown-extension/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# python generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info

# venv
.venv

.idea/
1 change: 1 addition & 0 deletions python-markdown-extension/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12.3
33 changes: 33 additions & 0 deletions python-markdown-extension/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[project]
name = "python_markdown_document_offsets_injection_extension"
version = "0.0.1"
description = "A Python-Markdown compiler plugin that put markdown words offset to the output HTML."
authors = [{ name = "HikariLan", email = "[email protected]" }]
license = { text = "Apache-2.0" }
dependencies = [
"markdown>=3.6",
]
requires-python = ">= 3.8"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = [
"pygments>=2.18.0",
"pymdown-extensions>=10.8.1",
]

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ["src/python_markdown_document_offsets_injection_extension"]

[tool.rye.scripts]
test = "python ./test"

[project.entry-points."markdown.extensions"]
document-offsets-injection = "python_markdown_document_offsets_injection_extension.extension:MainExtension"
18 changes: 18 additions & 0 deletions python-markdown-extension/requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false
# generate-hashes: false

-e file:.
markdown==3.6
# via pymdown-extensions
# via python-markdown-document-offsets-injection-extension
pygments==2.18.0
pymdown-extensions==10.8.1
pyyaml==6.0.1
# via pymdown-extensions
13 changes: 13 additions & 0 deletions python-markdown-extension/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false
# generate-hashes: false

-e file:.
markdown==3.6
# via python-markdown-document-offsets-injection-extension
Loading