shunk031 commited on
Commit
3bef9b3
·
unverified ·
1 Parent(s): 9c9d7b9

Use uv (#27)

Browse files

* Use uv

* Refactor CI workflow to use Makefile for dependency management and task execution

* Add Makefile setup step to CI workflow for dependency installation

Files changed (5) hide show
  1. .github/workflows/ci.yaml +7 -11
  2. Makefile +31 -0
  3. poetry.lock +0 -0
  4. pyproject.toml +17 -25
  5. uv.lock +0 -0
.github/workflows/ci.yaml CHANGED
@@ -26,25 +26,21 @@ jobs:
26
 
27
  - name: Install dependencies
28
  run: |
29
- pip install -U pip setuptools wheel poetry
30
- poetry install
31
 
32
  - name: Format
33
  run: |
34
- poetry run black --check .
35
 
36
  - name: Lint
37
  run: |
38
- poetry run ruff check .
39
 
40
  - name: Type check
41
  run: |
42
- poetry run mypy . \
43
- --ignore-missing-imports \
44
- --no-strict-optional \
45
- --no-site-packages \
46
- --cache-dir=/dev/null
47
-
48
  - name: Run tests
49
  run: |
50
- poetry run pytest --color=yes -rf
 
26
 
27
  - name: Install dependencies
28
  run: |
29
+ make setup
30
+ make install
31
 
32
  - name: Format
33
  run: |
34
+ make format
35
 
36
  - name: Lint
37
  run: |
38
+ make lint
39
 
40
  - name: Type check
41
  run: |
42
+ make typecheck
43
+
 
 
 
 
44
  - name: Run tests
45
  run: |
46
+ make test
Makefile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # Installation
3
+ #
4
+
5
+ .PHONY: setup
6
+ setup:
7
+ pip install -U uv
8
+
9
+ .PHONY: install
10
+ install:
11
+ uv sync
12
+
13
+ #
14
+ # linter/formatter/typecheck
15
+ #
16
+
17
+ .PHONY: lint
18
+ lint: install
19
+ uv run ruff check --output-format=github .
20
+
21
+ .PHONY: format
22
+ format: install
23
+ uv run ruff format --check --diff .
24
+
25
+ .PHONY: typecheck
26
+ typecheck: install
27
+ uv run mypy --cache-dir=/dev/null .
28
+
29
+ .PHONY: test
30
+ test: install
31
+ uv run pytest -vsx --log-cli-level=INFO
poetry.lock DELETED
The diff for this file is too large to render. See raw diff
 
pyproject.toml CHANGED
@@ -1,31 +1,23 @@
1
- [tool.poetry]
2
  name = "huggingface-datasets-jglue"
3
  version = "1.1.0"
4
  description = "Dataset loading script for JGLUE: Japanese General Language Understanding Evaluation"
5
- authors = ["Shunsuke KITADA <[email protected]>"]
 
 
6
  readme = "README.md"
7
- package-mode = false
8
-
9
- [tool.poetry.dependencies]
10
- python = "^3.8"
11
- datasets = "^2.10.0"
12
- beautifulsoup4 = "^4.11.2"
13
- mecab-python3 = "^1.0.6"
14
- pyknp = "^0.6.1"
15
- mojimoji = "^0.0.12"
16
-
17
- [tool.poetry.group.dev.dependencies]
18
- ruff = "^0.0.241"
19
- black = "^23.1.0"
20
- mypy = "^1.0.1"
21
- pytest = "^7.2.1"
22
-
23
- [tool.ruff]
24
- target-version = "py38"
25
- ignore = [
26
- "E501", # line too long, handled by black
27
  ]
28
 
29
- [build-system]
30
- requires = ["poetry-core"]
31
- build-backend = "poetry.core.masonry.api"
 
 
 
 
1
+ [project]
2
  name = "huggingface-datasets-jglue"
3
  version = "1.1.0"
4
  description = "Dataset loading script for JGLUE: Japanese General Language Understanding Evaluation"
5
+ authors = [
6
+ { name = "Shunsuke Kitada", email = "[email protected]" },
7
+ ]
8
  readme = "README.md"
9
+ requires-python = ">=3.8"
10
+ dependencies = [
11
+ "beautifulsoup4>=4.11.2",
12
+ "datasets>=3.0.0",
13
+ "mecab-python3>=1.0.6",
14
+ "mojimoji>=0.0.12",
15
+ "pyknp>=0.6.1",
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ]
17
 
18
+ [dependency-groups]
19
+ dev = ["mypy>=1.0.0", "pytest>=6.0.0", "ruff>=0.1.5"]
20
+
21
+ [tool.mypy]
22
+ python_version = "3.10"
23
+ ignore_missing_imports = true
uv.lock ADDED
The diff for this file is too large to render. See raw diff