Skip to content

Commit b2719e9

Browse files
Copilotemptymalei
andauthored
chore: migrate to uv + pyproject.toml, remove requirements.txt and setup.py
Agent-Logs-Url: https://github.com/DataHerb/dataherb-python/sessions/4bcdf088-6f7f-474e-8356-cb8a3eafb8d0 Co-authored-by: emptymalei <663798+emptymalei@users.noreply.github.com>
1 parent ddcbd08 commit b2719e9

11 files changed

Lines changed: 3468 additions & 93 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@ jobs:
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v3
28-
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v4
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v5
3030
with:
3131
python-version: ${{ matrix.python-version }}
3232
- name: Install packages
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install pytest
36-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
37-
pip install .
33+
run: uv sync --extra dev
3834
- name: pre-commit
3935
uses: pre-commit/action@v3.0.0
4036
- name: Test with pytest
41-
run: pytest
37+
run: uv run pytest

MANIFEST.in

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

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,15 @@ We desigined the following workflow to share and index open datasets.
152152
153153
## Development
154154

155-
1. Create a virtual environment.
156-
2. Install runtime requirements: `pip install -r requirements.txt`
157-
3. Install development requirements: `pip install -r requirements-dev.txt`
158-
4. Run tests: `pytest tests/`
155+
1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/).
156+
2. Install the project and dev dependencies:
157+
```bash
158+
uv sync --extra dev
159+
```
160+
3. Run tests:
161+
```bash
162+
uv run pytest
163+
```
159164

160165
## Documentation
161166

dataherb/serve/save_mkdocs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import json
22
import os
3+
import shutil
34
import sys
45
import time
56
from pathlib import Path
67

78
import click
89
import yaml
9-
from distutils.dir_util import copy_tree
1010
from loguru import logger
1111
from slugify import slugify
1212

@@ -108,7 +108,7 @@ def create_mkdocs_theme(self):
108108

109109
mkdocs_template_path = Path(__file__).parent / "mkdocs_template"
110110

111-
copy_tree(str(mkdocs_template_path), str(self.mkdocs_folder))
111+
shutil.copytree(str(mkdocs_template_path), str(self.mkdocs_folder), dirs_exist_ok=True)
112112

113113
def create_mkdocs_yaml(self):
114114
"""creates mkdocs.yaml from mkdocs_templates.py"""

pyproject.toml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "dataherb"
7+
dynamic = ["version"]
8+
description = "Get clean datasets from DataHerb to boost your data science and data analysis projects"
9+
readme = "README.md"
10+
license = { text = "MIT" }
11+
authors = [
12+
{ name = "Lei Ma", email = "hi@leima.is" },
13+
]
14+
requires-python = ">=3.9"
15+
classifiers = [
16+
"Programming Language :: Python :: 3",
17+
"License :: OSI Approved :: MIT License",
18+
"Operating System :: OS Independent",
19+
]
20+
dependencies = [
21+
"pandas>=0.23",
22+
"requests>=2.22.0",
23+
"rapidfuzz>=0.2.2",
24+
"ruamel.yaml>=0.16.10",
25+
"click>=7.0",
26+
"inquirer>=2.6.3",
27+
"colorama>=0.4.3",
28+
"GitPython>=3.1.0",
29+
"loguru>=0.5.3",
30+
"datapackage>=1.15.2",
31+
"awscli==1.33.42",
32+
"docutils>=0.10,<0.16",
33+
"mkdocs-material==7.1.8",
34+
"python-slugify==5.0.2",
35+
"mkdocs-macros-plugin==0.5.12",
36+
"rich>=10.7.0",
37+
"validators==0.19.0",
38+
"yarl==1.9.4",
39+
"giturlparse==0.10.0",
40+
]
41+
42+
[project.optional-dependencies]
43+
dev = [
44+
"pytest>=7.1.2",
45+
]
46+
docs = [
47+
"mkdocs==1.3.0",
48+
"mkdocs-autorefs==0.4.1",
49+
"mkdocs-material==7.1.8",
50+
"mkdocs-material-extensions>=1.0.3",
51+
"mkdocstrings==0.18.1",
52+
"mkdocstrings-python==0.6.6",
53+
"mkdocstrings-python-legacy==0.2.2",
54+
]
55+
56+
[project.urls]
57+
Homepage = "https://github.com/DataHerb/dataherb-python"
58+
59+
[project.scripts]
60+
dataherb = "dataherb.command:dataherb"
61+
62+
[tool.hatch.version]
63+
path = "dataherb/version.py"
64+
65+
[tool.hatch.build.targets.wheel]
66+
packages = ["dataherb"]
67+
68+
[tool.hatch.build.targets.sdist]
69+
include = [
70+
"dataherb/**",
71+
"README.md",
72+
]
73+
74+
[tool.pytest.ini_options]
75+
testpaths = ["tests"]

requirements-dev.txt

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

requirements.docs.txt

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

requirements.serve.txt

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

requirements.txt

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

setup.py

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

0 commit comments

Comments
 (0)