Skip to content

Commit c0bef19

Browse files
committed
migrated to uv
1 parent c9c5bff commit c0bef19

9 files changed

Lines changed: 1752 additions & 765 deletions

File tree

‎.github/workflows/tests-ci.yml‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,20 @@ jobs:
1818
- "3.9"
1919
- "3.10"
2020
- "3.11"
21-
poetry-version:
22-
- "1.4"
2321
os:
2422
- 'ubuntu-latest'
2523

2624
runs-on: '${{ matrix.os }}'
2725

2826
steps:
29-
- uses: actions/checkout@v3
30-
- uses: actions/setup-python@v4
27+
- uses: actions/checkout@v4
28+
- name: 'Set up uv'
29+
uses: astral-sh/setup-uv@v5
3130
with:
31+
enable-cache: true
3232
python-version: '${{ matrix.python-version }}'
33-
- name: 'Set up poetry - Run image'
34-
uses: abatilo/actions-poetry@v2
35-
with:
36-
poetry-version: '${{ matrix.poetry-version }}'
37-
- name: 'Poetry Install'
38-
run: poetry install
33+
- name: 'Install the project'
34+
run: uv sync --locked
3935

4036
- name: 'Setup TeX Live (latex is needed for some latexpp tests)'
4137
uses: teatimeguest/setup-texlive-action@v2
@@ -48,4 +44,4 @@ jobs:
4844
etoolbox
4945
5046
- name: 'Run tests'
51-
run: poetry run pytest
47+
run: uv run --no-sync pytest

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ __pycache__
66

77
.python-version
88

9+
.venv
10+
911
junk
1012

1113
build

‎.readthedocs.yaml‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Configuration for readthedocs.org
33
#
44

5-
# See poetry builds on RTD:
5+
# See uv builds on RTD:
66
#
7-
# https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry
7+
# https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-uv
88
#
99

1010

@@ -20,15 +20,15 @@ build:
2020
jobs:
2121

2222
post_install:
23-
# Install poetry
24-
# https://python-poetry.org/docs/#installing-manually
25-
- 'pip install poetry'
26-
27-
# Install dependencies with 'docs' dependency group
28-
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
29-
# VIRTUAL_ENV needs to be set manually for now.
30-
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
31-
- 'VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with builddoc'
23+
# Install uv
24+
# https://docs.astral.sh/uv/getting-started/installation/
25+
- 'pip install uv'
26+
27+
# Install dependencies, including the (optional) 'builddoc' dependency
28+
# group. https://docs.astral.sh/uv/concepts/projects/dependencies/#dependency-groups
29+
# Install into the virtualenv RTD has already set up for us, rather than
30+
# letting uv create its own .venv.
31+
- 'VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv sync --locked --active --group builddoc'
3232

3333

3434
sphinx:

‎MANIFEST.in‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎README.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Latex preprocessor — apply macro definitions, remove comments, and more
66
*Disclaimer: latexpp is still at an experimental development stage.*
77

88
.. image:: https://img.shields.io/github/license/phfaist/latexpp.svg?style=flat
9-
:target: https://github.com/phfaist/latexpp/blob/master/LICENSE.txt
9+
:target: https://github.com/phfaist/latexpp/blob/main/License.txt
1010

1111

1212
Installation

‎poetry.lock‎

Lines changed: 0 additions & 721 deletions
This file was deleted.

‎pyproject.toml‎

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,50 @@
1-
[tool.poetry]
1+
[project]
22
name = "latexpp"
33
version = "0.2.0a4"
44
description = "Latex preprocessor — apply macro definitions, remove comments, and more"
5-
authors = ["Philippe Faist"]
5+
authors = [
6+
{ name = "Philippe Faist" },
7+
]
68
license = "MIT"
9+
license-files = ["License.txt"]
710
readme = "README.rst"
11+
requires-python = ">=3.7,<4.0"
12+
dependencies = [
13+
"pylatexenc>=3.0a15",
14+
"colorlog>=6.0.0a4",
15+
"PyYAML>=6.0,<7.0",
16+
]
817

9-
[tool.poetry.dependencies]
10-
python = "^3.7"
11-
pylatexenc = ">=3.0a15"
12-
colorlog = ">=6.0.0a4"
13-
PyYAML = "^6.0"
18+
[project.scripts]
19+
latexpp = "latexpp.__main__:main"
1420

15-
[tool.poetry.scripts]
16-
latexpp = 'latexpp.__main__:main'
21+
[dependency-groups]
22+
dev = [
23+
"pytest>=7.3.1,<8.0",
24+
"toml>=0.10.2,<0.11",
25+
]
26+
# 'builddoc' is opt-in only (see [tool.uv] default-groups below); install it
27+
# with `uv sync --group builddoc`
28+
builddoc = [
29+
"Sphinx>=5.0.0",
30+
"sphinx-issues>=3.0.0",
31+
]
1732

18-
[tool.poetry.group.dev.dependencies]
19-
pytest = "^7.3.1"
20-
toml = "^0.10.2"
33+
[tool.uv]
34+
default-groups = ["dev"]
2135

22-
[tool.poetry.group.builddoc]
23-
optional = true
36+
[tool.hatch.build.targets.wheel]
37+
packages = ["latexpp"]
2438

25-
[tool.poetry.group.builddoc.dependencies]
26-
Sphinx = ">=5.0.0"
27-
sphinx-issues = ">=3.0.0"
39+
[tool.hatch.build.targets.sdist]
40+
include = [
41+
"latexpp",
42+
"test",
43+
"doc",
44+
"README.rst",
45+
"License.txt",
46+
]
2847

2948
[build-system]
30-
requires = ["poetry-core"]
31-
build-backend = "poetry.core.masonry.api"
49+
requires = ["hatchling"]
50+
build-backend = "hatchling.build"

‎test/test_latexpp.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_versions_are_in_sync(self):
1515
path = os.path.join( os.path.dirname(__file__), '..', "pyproject.toml" )
1616
with open(path) as fpp:
1717
pyproject = toml.loads(fpp.read())
18-
pyproject_version = pyproject["tool"]["poetry"]["version"]
18+
pyproject_version = pyproject["project"]["version"]
1919

2020
package_init_version = latexpp.__version__
2121

0 commit comments

Comments
 (0)