Skip to content

Commit 868427c

Browse files
committed
feat: change to uv
1 parent 2992c36 commit 868427c

6 files changed

Lines changed: 3408 additions & 104 deletions

File tree

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,50 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3-
41
name: compute-geometry
52

63
on:
74
push:
8-
branches: [ "main" ]
5+
branches: ["main"]
96
pull_request:
10-
branches: [ "main" ]
7+
branches: ["main"]
118

129
jobs:
13-
build:
14-
10+
lint-test:
1511
runs-on: ubuntu-latest
1612
strategy:
1713
fail-fast: false
1814
matrix:
1915
python-version: ["3.9", "3.10", "3.11"]
2016

2117
steps:
22-
- uses: actions/checkout@v3
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v3
25-
with:
26-
python-version: ${{ matrix.python-version }}
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
python -m pip install flake8 pytest
31-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32-
- name: Lint with flake8
33-
run: |
34-
# stop the build if there are Python syntax errors or undefined names
35-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38-
- name: Test with pytest
39-
run: |
40-
pytest
18+
- uses: actions/checkout@v4
19+
- name: Set up uv
20+
uses: astral-sh/setup-uv@v4
21+
- name: Install Python ${{ matrix.python-version }}
22+
run: uv python install ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: uv sync --dev
25+
- name: Lint with flake8
26+
run: |
27+
# stop the build if there are Python syntax errors or undefined names
28+
uv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30+
uv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
- name: Test with pytest
32+
run: uv run pytest
4133

42-
- name: Publish distribution to PyPI
43-
uses: pypa/gh-action-pypi-publish@master
44-
with:
45-
password: ${{ secrets.test_pass_pypi }}
46-
repository_url: https://upload.pypi.org/legacy/
34+
publish:
35+
needs: lint-test
36+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Set up uv
41+
uses: astral-sh/setup-uv@v4
42+
- name: Install Python
43+
run: uv python install 3.11
44+
- name: Build package
45+
run: uv build
46+
- name: Publish distribution to PyPI
47+
uses: pypa/gh-action-pypi-publish@release/v1
48+
with:
49+
password: ${{ secrets.test_pass_pypi }}
50+
repository-url: https://upload.pypi.org/legacy/

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
playground/
1+
playground/
2+
__pycache__/
3+
*.py[cod]
4+
*.egg-info/
5+
dist/
6+
build/
7+
.venv/

README.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,14 @@
66
[![GitHub](https://img.shields.io/github/license/kleyt0n/compute-geometry)](https://github.com/kleyt0n/compute-geometry/blob/master/LICENSE)
77

88

9-
Welcome to the **compute-geometry** library, a comprehensive computational geometry library for Python. This library is designed to provide a set of tools and algorithms for solving geometric problems, making it a valuable resource for developers and researchers working in areas such as computer graphics, robotics, and geographic information systems.
10-
11-
## Features
12-
13-
- **Geometry Primitives:** Efficient implementations of fundamental geometric primitives, including points, lines, and polygons.
14-
15-
- **Algorithms:** A variety of computational geometry algorithms, such as convex hull computation, line segment intersection, and Voronoi diagram generation.
16-
17-
- **Geometry Operations:** Functions for performing common geometric operations, such as distance calculations, area computations, and geometric transformations.
18-
19-
- **Visualization:** Functions for visualizing geometric objects and algorithms using Matplotlib.
20-
21-
- **Documentation:** Comprehensive documentation with usage examples to help you quickly integrate the library into your projects.
9+
**compute-geometry** is a research-focused computational geometry library for Python. This library is designed to provide a set of tools and algorithms for solving geometric problems.
2210

2311
## Installation
2412

2513
You can install the **compute-geometry** library using `pip`:
2614

2715
```bash
28-
pip install compute-geometry
16+
uv add compute-geometry
2917
```
3018

3119
## Getting Started
@@ -72,10 +60,6 @@ voronoi.plot_voronoi(cells)
7260

7361
```
7462

75-
## Contributing
76-
77-
Contributions to the _compute-geometry_ library are welcome! If you have additional algorithms, improvements, or bug fixes, please submit a pull request. Be sure to follow the [contribution guidelines](CONTRIBUTING.md) outlined in the repository.
78-
7963
## License
8064

8165
This library is licensed under the [MIT License](LICENSE), allowing you to use, modify, and distribute it for both commercial and non-commercial purposes.

pyproject.toml

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
1-
[tool.commitizen]
2-
version = "0.7.2"
3-
changelog_incremental = true
4-
version_files = [
5-
"pyproject.toml:version"
6-
]
7-
8-
[tool.poetry]
1+
[project]
92
name = "compute-geometry"
10-
version = "0.1.0"
3+
version = "0.1.1"
114
description = "Computational Geometry Library"
12-
authors = ["Kleyton da Costa"]
13-
maintainers = ["Kleyton da Costa <kleyton.vsc@gmail.com>"]
145
readme = "README.md"
15-
16-
packages = [
17-
{ include = "cgeom" },
18-
{ include = "cgeom/**/*.py" },
6+
requires-python = ">=3.9"
7+
authors = [
8+
{ name = "Kleyton da Costa", email = "kleyton.vsc@gmail.com" },
9+
]
10+
maintainers = [
11+
{ name = "Kleyton da Costa", email = "kleyton.vsc@gmail.com" },
12+
]
13+
dependencies = [
14+
"numpy>=1.22.0",
15+
"pandas>=1.4.0",
16+
"matplotlib>=3.5.0",
17+
"rich>=13.0.0",
18+
"seaborn>=0.11.2",
1919
]
2020

21-
[tool.poetry.dependencies]
22-
python = ">=3.8,<4.0.0"
21+
[dependency-groups]
22+
dev = [
23+
"flake8>=5.0.4",
24+
"pre-commit>=2.20.0",
25+
"pytest>=7.1.3",
26+
"commitizen>=2.40.0",
27+
"ipykernel>=6.25.2",
28+
]
2329

24-
tqdm = {version=">=4.64.1", optional = true}
25-
seaborn = {version=">=0.11.2", optional = true}
30+
[build-system]
31+
requires = ["hatchling"]
32+
build-backend = "hatchling.build"
2633

27-
[tool.poetry.group.dev.dependencies]
28-
flake8 = "^5.0.4"
29-
pre-commit = "^2.20.0"
30-
pytest = "^7.1.3"
31-
commitizen = "^2.40.0"
32-
ipykernel = "^6.25.2"
34+
[tool.hatch.build.targets.wheel]
35+
packages = ["cgeom"]
3336

34-
[build-system]
35-
requires = ["poetry-core"]
36-
build-backend = "poetry.core.masonry.api"
37+
[tool.commitizen]
38+
version = "0.7.2"
39+
changelog_incremental = true
40+
version_files = [
41+
"pyproject.toml:version"
42+
]

setup.py

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

0 commit comments

Comments
 (0)