Skip to content

Commit

Permalink
setup
Browse files Browse the repository at this point in the history
  • Loading branch information
daizutabi committed Jun 30, 2024
0 parents commit 230c7be
Show file tree
Hide file tree
Showing 13 changed files with 787 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches: [main]
pull_request:

concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
run:
name: Python ${{ matrix.python-version }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
run: pip install --upgrade hatch
- name: Check format
run: hatch fmt --check
- name: Install Packages
run: |
pip install -e .
- name: Run test
run: pytest --capture=fd
- name: Upload Codecov Results
if: success()
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: lcov.info
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Documentation
on:
push:
branches: [main]
tags: ["*"]
permissions:
contents: write
jobs:
deploy:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Hatch
run: pip install --upgrade hatch
- name: Deploy documentation
run: hatch run docs:deploy
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.egg
*.egg-info/
.coverage
.hatch/
.ipynb_checkpoints
__pycache__/
build/
dist/
lcov.info
sdist/
9 changes: 9 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2020-present daizutabi <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# pptxlib

[![PyPI Version][pypi-v-image]][pypi-v-link]
[![Python Version][python-v-image]][python-v-link]
[![Build Status][GHAction-image]][GHAction-link]
[![Coverage Status][codecov-image]][codecov-link]

<!-- Badges -->
[pypi-v-image]: https://img.shields.io/pypi/v/pptxlib.svg
[pypi-v-link]: https://pypi.org/project/pptxlib/
[python-v-image]: https://img.shields.io/pypi/pyversions/pptxlib.svg
[python-v-link]: https://pypi.org/project/pptxlib
[GHAction-image]: https://github.com/daizutabi/pptxlib/actions/workflows/ci.yml/badge.svg?branch=main&event=push
[GHAction-link]: https://github.com/daizutabi/pptxlib/actions?query=event%3Apush+branch%3Amain
[codecov-image]: https://codecov.io/github/daizutabi/pptxlib/coverage.svg?branch=main
[codecov-link]: https://codecov.io/github/daizutabi/pptxlib?branch=main
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# pptxlib
49 changes: 49 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
site_name: pptxlib
site_url: https://daizutabi.github.io/pptxlib/
site_description: PDF documentation generator
site_author: daizutabi
repo_url: https://github.com/daizutabi/pptxlib/
repo_name: daizutabi/pptxlib
edit_uri: edit/main/docs/
theme:
name: material
icon:
repo: fontawesome/brands/github
palette:
- scheme: default
primary: indigo
accent: indigo
toggle:
icon: material/weather-sunny
name: Switch to dark mode
- scheme: slate
primary: black
accent: black
toggle:
icon: material/weather-night
name: Switch to light mode
features:
- content.tooltips
- content.code.annotate
- navigation.expand
- navigation.indexes
- navigation.instant
- navigation.sections
- navigation.tabs
- navigation.tabs.sticky
- navigation.top
- navigation.tracking
plugins:
- search:
markdown_extensions:
- pymdownx.magiclink
- pymdownx.highlight:
use_pygments: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
- mkdocs-typer
nav:
- index.md
105 changes: 105 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "pptxlib"
description = "PowerPoint lib"
readme = "README.md"
license = "MIT"
authors = [{ name = "daizutabi", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: MkDocs",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Documentation",
"Topic :: Software Development :: Documentation",
]
dynamic = ["version"]
requires-python = ">=3.10"
dependencies = []

[project.urls]
Documentation = "https://daizutabi.github.io/pptxlib"
Source = "https://github.com/daizutabi/pptxlib"
Issues = "https://github.com/daizutabi/pptxlib/issues"

[project.scripts]
pptxlib = "pptxlib.main:app"

[tool.hatch.version]
path = "src/pptxlib/__about__.py"

[tool.hatch.build.targets.sdist]
exclude = ["/.github", "/docs"]
[tool.hatch.build.targets.wheel]
packages = ["src/pptxlib"]

[tool.hatch.envs.test]
dependencies = [
"pytest-clarity",
"pytest-cov",
"pytest-randomly",
"pytest-xdist",
]

[tool.hatch.envs.test.scripts]
run = "pytest {args:tests src/pptxlib}"
cov = "coverage report {args:--skip-covered --show-missing}"

[[tool.hatch.envs.test.matrix]]
python = ["3.10", "3.11", "3.12"]

[tool.pytest.ini_options]
addopts = [
"--color=yes",
"--cov-report=lcov:lcov.info",
"--cov=pptxlib",
"--doctest-modules",
"--tb=short",
]
doctest_optionflags = ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]
filterwarnings = ['ignore:setDaemon\(\) is deprecated:DeprecationWarning']

[tool.coverage.run]
omit = ["src/pptxlib/__about__.py"]

[tool.coverage.report]
exclude_lines = [
"# pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]

[tool.hatch.envs.docs]
dependencies = ["mkdocs-material", "mkdocs-typer"]
python = "3.12"

[tool.hatch.envs.docs.scripts]
build = "mkdocs build --clean --strict {args}"
serve = "mkdocs serve --dev-addr localhost:8000 {args}"
deploy = "mkdocs gh-deploy --force"

[tool.hatch.envs.hatch-static-analysis]
config-path = "ruff_defaults.toml"

[tool.ruff]
line-length = 100
target-version = "py312"
extend = "ruff_defaults.toml"

[tool.ruff.lint]
ignore = ['RUF001']
unfixable = [
"F401", # Don't touch unused imports
"RUF100", # Don't touch noqa lines
]

[tool.ruff.lint.extend-per-file-ignores]
"main.py" = ["ARG001", "UP007"]

[tool.ruff.lint.pydocstyle]
convention = "google"
Loading

0 comments on commit 230c7be

Please sign in to comment.