Skip to content

Commit 2b9eff0

Browse files
authored
Merge pull request #7 from iamtatsuki05/develop
Relese Develop
2 parents c5deb11 + c924c68 commit 2b9eff0

9 files changed

Lines changed: 2788 additions & 4394 deletions

File tree

.github/workflows/test_docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
docker compose build --progress=plain
3333
docker compose up -d
3434
- name: Test
35-
run: docker compose exec python-cpu poetry run tox
35+
run: docker compose exec python-cpu uv run tox

.github/workflows/test_poetry.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ jobs:
3333
sudo apt-get update
3434
sudo apt-get install -y mecab libmecab-dev mecab-ipadic-utf8
3535
36-
- name: Install Poetry
36+
- name: Install uv
3737
run: |
38-
curl -sSL https://install.python-poetry.org | python3 -
38+
curl -LsSf https://astral.sh/uv/install.sh | sh
3939
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
4040
4141
- name: Install dependencies
4242
run: |
43-
poetry install
43+
uv sync
4444
4545
- name: Run tests
4646
run: |
47-
poetry run tox
47+
uv run tox

compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
ports:
2121
- "8888:8888"
2222
command:
23-
poetry run jupyter lab
23+
uv run jupyter lab
2424
--ip=0.0.0.0
2525
--allow-root
2626
--NotebookApp.token=''

docker/cpu/Dockerfile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,19 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
4242
&& pip3 --no-cache-dir install --upgrade pip
4343

4444
## install Poetry
45-
RUN curl -sSL https://install.python-poetry.org | python3 -
46-
ENV PATH $PATH:/root/.local/bin
47-
RUN poetry config virtualenvs.create true \
48-
&& poetry config virtualenvs.in-project false
45+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
4946

5047
WORKDIR ${WORKDIR}
5148

5249
# install python packages
53-
COPY poetry.lock pyproject.toml ./
50+
COPY uv.lock pyproject.toml ./
5451
COPY src ./src
55-
RUN poetry install --no-dev
52+
RUN uv sync --frozen --no-cache
5653

5754
FROM base AS dev
5855
WORKDIR ${WORKDIR}
5956

6057
# install python packages
61-
COPY poetry.lock pyproject.toml ./
58+
COPY uv.lock pyproject.toml ./
6259
COPY src ./src
63-
RUN poetry install
60+
RUN uv sync --frozen --no-cache

poetry.lock

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

pyproject.toml

Lines changed: 66 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,75 @@
1-
[tool.poetry]
1+
[project]
22
name = "project"
33
version = "0.1.0"
4-
description = ""
5-
authors = ["iamtatsuki05 <tatsukio0522@gmail.com>"]
6-
packages = [
7-
{ include = "project", from = "src/" },
4+
description = "Add your description here"
5+
requires-python = ">=3.10"
6+
dependencies = [
7+
"python-dotenv==1.0.0",
8+
"setuptools==69.0.3",
9+
"fire==0.5.0",
10+
"pydantic==2.5.3",
11+
"beautifulsoup4==4.12.2",
12+
"selenium==4.16.0",
13+
"fastapi==0.108.0",
14+
"uvicorn==0.25.0",
15+
"matplotlib==3.5.1",
16+
"pandas==1.4.2",
17+
"seaborn==0.11.2",
18+
"japanize-matplotlib==1.1.3",
19+
"numpy==1.22.3",
20+
"jupyterlab==3.3.4",
21+
"tqdm==4.64.0",
22+
"scikit-learn==1.1.1",
23+
"openpyxl==3.1.2",
24+
"polars==0.20.31",
25+
"aiohttp==3.9.5",
26+
"tenacity==8.4.1",
27+
"playwright==1.44.0",
828
]
929

10-
[tool.poetry.dependencies]
11-
python = "^3.10"
12-
python-dotenv = "^1.0.0"
13-
setuptools = "^69.0.3"
14-
fire = "^0.5.0"
15-
pydantic = "^2.5.3"
16-
beautifulsoup4 = "^4.12.2"
17-
selenium = "^4.16.0"
18-
fastapi = "^0.108.0"
19-
uvicorn = "^0.25.0"
20-
matplotlib = "^3.5.1"
21-
pandas = "^1.4.2"
22-
seaborn = "^0.11.2"
23-
japanize-matplotlib = "^1.1.3"
24-
numpy = "^1.22.3"
25-
jupyterlab = "^3.3.4"
26-
tqdm = "^4.64.0"
27-
scikit-learn = "^1.1.1"
28-
openpyxl = "^3.1.2"
29-
polars = "^0.20.31"
30-
aiohttp = "^3.9.5"
31-
tenacity = "^8.4.1"
32-
playwright = "^1.44.0"
30+
[tool.hatch.build.targets.wheel]
31+
packages = ["src/project", "src"]
3332

34-
[tool.poetry.group.dev.dependencies]
35-
pytest = "^7.0.0"
36-
ipykernel = ">=6.13.0"
37-
autopep8 = ">=1.6.0"
38-
autoflake = ">=1.4"
39-
flake8 = ">=4.0.1"
40-
flake8-isort = ">=4.1.1"
41-
flake8-quotes = ">=3.3.1"
42-
flake8-print = ">=4.0.0"
43-
isort = ">=5.10.1"
44-
black = {extras = ["jupyter"], version = "^22.6.0"}
45-
mypy = ">=0.971"
46-
tox = ">=3.25.1"
47-
pre-commit = ">=3.3.3"
48-
nbstripout = "0.6.1"
33+
[tool.uv]
34+
dev-dependencies = [
35+
"jupyterlab>=3.3.4",
36+
"mypy>=1.11.2",
37+
"nbstripout>=0.7.1",
38+
"pre-commit>=4.0.1",
39+
"pytest>=8.3.3",
40+
"ruff>=0.6.9",
41+
"tox>=4.21.2",
42+
]
4943

50-
[tool.isort]
51-
profile = "black"
52-
line_length = 88
53-
multi_line_output = 3
54-
include_trailing_comma = true
55-
skip = [".venv", ".tox"]
44+
[tool.ruff]
45+
line-length = 119
46+
target-version = "py310"
47+
exclude = [".git", ".venv", "__pycache__", "data", "dist", "misc", "notebooks", "prof", "tmp", "workspacea", ".tox"]
5648

57-
[tool.black]
58-
skip-string-normalization = true
59-
include = '\.py$'
49+
[tool.ruff.format]
50+
quote-style = "single"
51+
indent-style = "space"
52+
skip-magic-trailing-comma = false
53+
line-ending = "auto"
6054

61-
[tool.pytest.ini_options]
62-
testpaths = "tests/"
55+
[tool.ruff.lint]
56+
extend-select = [
57+
"I", # isort
58+
]
59+
# ignores
60+
ignore = ["E501"]
61+
62+
[tool.ruff.lint.isort]
63+
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
64+
split-on-trailing-comma = true
65+
66+
[tool.ruff.lint.pyupgrade]
67+
# Python3.8互換のための設定
68+
keep-runtime-typing = true
6369

6470
[tool.mypy]
65-
python_version=3.10
66-
files = "src/project"
71+
python_version="3.10"
72+
files = "src"
6773
ignore_missing_imports = true
6874
disallow_untyped_defs = true
6975
no_implicit_optional = true
@@ -72,11 +78,9 @@ show_error_codes = true
7278
pretty = true
7379
allow_untyped_globals = true
7480

75-
[tool.flake8]
76-
max-line-length = 119
77-
ignore = "D, E203, W391, W503"
78-
exclude = " .git, .venv, __pycache__, data, dist, misc, notebooks, prof, tmp, workspacea, .tox"
81+
[tool.pytest.ini_options]
82+
filterwarnings = ["ignore::DeprecationWarning",]
7983

8084
[build-system]
81-
requires = ["poetry-core>=1.0.0"]
82-
build-backend = "poetry.core.masonry.api"
85+
requires = ["hatchling"]
86+
build-backend = "hatchling.build"

src/project/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
def main():
1+
from project.env import PACKAGE_DIR
2+
3+
4+
def main() -> None:
25
print('Hello, World!')
6+
print(f'PACKAGE_DIR: {PACKAGE_DIR}')
37

48

59
if __name__ == '__main__':

tox.ini

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ commands =
1414

1515
[testenv:lint]
1616
allowlist_externals =
17-
pflake8
17+
ruff
1818
mypy
19-
black
20-
isort
2119
skip_install = true
2220
commands =
23-
# pflake8 --show-source --statistics src/ tests {posargs}
24-
# mypy . {posargs}
25-
black --check . {posargs}
26-
isort --check-only . {posargs}
21+
ruff check --output-format=full src/ tests {posargs}
22+
mypy src/ {posargs}
23+
ruff format --check ./

0 commit comments

Comments
 (0)