-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Run 'rye init' - Copy personal files - Configure for namespace package
- Loading branch information
0 parents
commit 8c33618
Showing
23 changed files
with
500 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
current_version = "0.0.0" | ||
|
||
[[files]] | ||
path = "pyproject.toml" | ||
search = "version = \"{{current_version}}\"" | ||
replace = "version = \"{{new_version}}\"" | ||
|
||
[[files]] | ||
path = "src/atsphinx/helpers/__init__.py" | ||
search = "__version__ = \"{{current_version}}\"" | ||
replace = "__version__ = \"{{new_version}}\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Run CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: '.python-version' | ||
- name: Lint by pre-commit | ||
run: | | ||
pip install pre-commit | ||
pre-commit run --all-files | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.9', '3.10', '3.11', '3.12'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Configure venv | ||
run: | | ||
pip install uv | ||
uv venv | ||
uv pip install -r requirements-dev.lock | ||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
pytest | ||
doctest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: '.python-version' | ||
- name: Configure venv | ||
run: | | ||
pip install uv | ||
uv venv | ||
uv pip install -r requirements-dev.lock | ||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
make -C doc linkcheck dirhtml | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: '.python-version' | ||
- name: Build package | ||
run: | | ||
pip install hatch | ||
hatch build | ||
ls -l dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: 'Release new version' | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: '.python-version' | ||
- name: Build package | ||
run: | | ||
pip install hatch | ||
hatch build | ||
ls -l dist | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: packages-${{ github.ref_name }} | ||
path: dist/ | ||
gh-release: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: packages-${{ github.ref_name }} | ||
path: dist/ | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: 'dist/*' | ||
bodyFile: 'CHANGESLOG.rst' | ||
draft: false | ||
name: Release ${{ github.ref_name }} | ||
tag: ${{ github.ref }} | ||
prerelease: false | ||
publish-pypi: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: success() && ${{ needs.prepare.outputs.is-release }} | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: packages-${{ github.ref_name }} | ||
path: dist/ | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
deploy-doc: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: '.python-version' | ||
- name: Configure venv | ||
run: | | ||
pip install uv | ||
uv venv | ||
uv pip install -r requirements-dev.lock | ||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
make -C doc dirhtml | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: doc/_build/dirhtml | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# python generated files | ||
__pycache__/ | ||
*.py[oc] | ||
build/ | ||
dist/ | ||
wheels/ | ||
*.egg-info | ||
|
||
# venv | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.3.0 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
# Run the formatter. | ||
- id: ruff-format | ||
- repo: https://github.com/PyCQA/doc8 | ||
rev: v1.0.0 | ||
hooks: | ||
- id: doc8 | ||
args: | ||
- --max-line-length=119 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ver 0.0.0 | ||
========= | ||
|
||
:date: 2024-03-16 JST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
================ | ||
atsphinx-helpers | ||
================ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
_build | ||
api/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
extend = "../pyproject.toml" | ||
|
||
[lint] | ||
ignore = ["D100", "D103"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from atsphinx.helpers import __version__ | ||
|
||
# -- Project information ----------------------------------------------------- | ||
project = "atsphinx-helpers" | ||
copyright = "2024, Kazuya Takei" | ||
author = "Kazuya Takei" | ||
release = __version__ | ||
|
||
# -- General configuration --------------------------------------------------- | ||
extensions = [] | ||
templates_path = ["_templates"] | ||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
html_theme = "furo" | ||
html_static_path = ["_static"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
==== | ||
Home | ||
==== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=. | ||
set BUILDDIR=_build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
[project] | ||
name = "atsphinx-helpers" | ||
version = "0.0.0" | ||
description = "Helper for my Sphinx extension" | ||
authors = [ | ||
{ name = "Kazuya Takei", email = "[email protected]" } | ||
] | ||
dependencies = [ | ||
"sphinx", | ||
] | ||
readme = "README.rst" | ||
requires-python = ">= 3.9" | ||
license = "Apache-2.0" | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Framework :: Sphinx", | ||
"Framework :: Sphinx :: Extension", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Documentation :: Sphinx", | ||
] | ||
|
||
[project.urls] | ||
Home = "https://github.com/atsphinx/helpers" | ||
Repository = "https://github.com/atsphinx/helpers" | ||
Issues = "https://github.com/atsphinx/helpers/issues" | ||
Changelog = "https://github.com/atsphinx/helpers/blob/main/CHANGES.rst" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.rye] | ||
managed = true | ||
dev-dependencies = [ | ||
"furo~=2024.1.29", | ||
"pytest~=8.0.2", | ||
"sphinx~=7.2.6", | ||
] | ||
|
||
[tool.rye.scripts] | ||
setup = {chain = ["setup:sync", "setup:pre-commit"]} | ||
"setup:sync" = "rye sync --no-lock --all-features" | ||
"setup:pre-commit" = "pre-commit install" | ||
|
||
[tool.ruff.lint] | ||
select = ["C90", "D", "E", "F", "I", "W"] | ||
|
||
[tool.ruff.lint.pydocstyle] | ||
convention = "pep257" | ||
|
||
[tool.hatch.metadata] | ||
allow-direct-references = true | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/atsphinx"] | ||
only-includes = ["src/atsphinx"] |
Oops, something went wrong.