Skip to content

Commit

Permalink
feat: Use Rye for project management
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Mar 23, 2024
1 parent 44cabed commit a4d4569
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 34 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ jobs:
with:
architecture: x64
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install dependencies
run: pip install cookiecutter pre-commit
- name: Create demo project
run: |
pip install cookiecutter
cookiecutter --no-input --output-dir=var .
python -m venv var/venv
source var/venv/bin/activate
- uses: eifinger/setup-rye@v2
- name: Verify created project
run: |
cd var/demo
git init
pip install '.[test]'
pytest
make -C docs dirhtml
rye sync
rye run pytest
rye run doc dirhtml
pre-commit run --all-files
71 changes: 43 additions & 28 deletions {{cookiecutter.project_basename}}/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "{{ cookiecutter.project_name }}"
version = "{{ cookiecutter.version }}"
description = "{{ cookiecutter.description }}"
authors = [{name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.author_email }}"}]
license = {file = "LICENSE"}
license = "Apache-2.0"
requires-python = ">= 3.8"
classifiers = [
"Development Status :: 3 - Alpha",
"Framework :: Sphinx",
"Framework :: Sphinx :: Extension",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Documentation :: Sphinx",
"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.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Documentation :: Sphinx",
"Topic :: Software Development",
"Topic :: Software Development :: Documentation",

]
readme = "README.rst"
dependencies = [
"sphinx",
]
dynamic = ["version", "description"]

[project.optional-dependencies]
doc = []
test = [
"pytest ==7.*",
"sphinx",
]

[project.urls]
Home = "https://github.com/atsphinx/{{ cookiecutter.project_basename }}"

[tool.flit.module]
name = "{{ cookiecutter.package_fullname }}"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = [
"pytest ==7.*",
]

[tool.rye.scripts]
setup = {chain = ["setup:sync", "setup:pre-commit"]}
"setup:sync" = "rye sync --no-lock --all-features"
"setup:pre-commit" = "pre-commit install"
doc = "make -C docs"

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

[tool.flit.sdist]
exclude = [".github", "tests"]
[tool.hatch.build.targets.wheel]
packages = ["src/atsphinx"]
only-includes = ["src/atsphinx"]

0 comments on commit a4d4569

Please sign in to comment.