Skip to content

Commit

Permalink
pipfileからuvへの移行
Browse files Browse the repository at this point in the history
  • Loading branch information
massongit committed Dec 16, 2024
1 parent 5c9a83a commit cfc7357
Show file tree
Hide file tree
Showing 16 changed files with 297 additions and 593 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-update-readme-sudden-death.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: sed -i -e "s/Python [0-9.]*/Python $(cat .python-version)/g" README.md
run: sed -i -e "s/Python [0-9.]*/Python $(yq '.project.requires-python' pyproject.toml | sed -e 's/==//g')/g" README.md
- uses: dev-hato/actions-diff-pr-management@8d475e5bc78f61c40024d4859b79134b66f788d2 # v1.2.1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include Pipfile
include pyproject.toml
21 changes: 0 additions & 21 deletions Pipfile

This file was deleted.

228 changes: 0 additions & 228 deletions Pipfile.lock

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
## Requirements

- Python 3.13.1
- `pipenv install`
- `uv sync`
- `npm install`

## Usage

sd.pyを実行することで次に入力した文字が吹き出しになって出力されます。また、同時に出力された吹き出しはクリップボードにもコピーされます。

```sh
pipenv run python sd.py メッセージ
uv run sd.py メッセージ
```

## lintをかける方法
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"lint": "npm run lint:markdown && npm run lint:text && npm run lint:python && npm run lint:python-type && npm run lint:secret",
"lint:markdown": "markdownlint -c .markdown-lint.yml -i node_modules .",
"lint:text": "textlint -c .textlintrc $(find . -name '*.md' | grep -v node_modules)",
"lint:python": "pipenv run pylint --rcfile .python-lint *.py",
"lint:python-type": "pipenv run mypy --config-file .mypy.ini --install-types --non-interactive *.py",
"lint:python": "uv tool run pylint --rcfile .python-lint *.py",
"lint:python-type": "uv tool run mypy --config-file .mypy.ini --install-types --non-interactive *.py",
"lint:secret": "docker run --rm --platform=linux/amd64 -v $(pwd):/path -w /path zricethezav/gitleaks protect --verbose --redact"
},
"devDependencies": {
Expand Down
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[project]
name = "sudden_death"
version = "0.0.1"
description = "突然の死(ハリフキダシ)を生成するツール"
requires-python = "==3.13.1"
dependencies = [
"click==8.1.7",
"pyperclip>=1.5.27",
]

[dependency-groups]
dev = ["autopep8==2.3.1", "pylint==3.3.2", "mypy==1.13.0", "flake8==7.1.1", "importlib-metadata==8.5.0", "toml==0.10.2", "types-toml==0.10.8.20240310", "setuptools==75.6.0", "toml==0.10.2", ]

[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"
5 changes: 0 additions & 5 deletions scripts/pipenv_install.sh

This file was deleted.

8 changes: 3 additions & 5 deletions scripts/pr_copy_ci_sudden_death/pr_copy_ci/copy_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ for f in $(find hato-bot/scripts -type f | grep -v hato_bot | sed -e "s:hato-bot
cp "hato-bot/${f}" "sudden-death/${f}"
done

for f in .markdown-lint.yml .python-lint .textlintrc .gitleaks.toml .mypy.ini .pre-commit-config.yaml .python-version .pep8 .flake8 .python-black .isort.cfg .prettierignore renovate.json requirements.txt; do
for f in .markdown-lint.yml .python-lint .textlintrc .gitleaks.toml .mypy.ini .pre-commit-config.yaml .pep8 .flake8 .python-black .isort.cfg .prettierignore renovate.json requirements.txt; do
rm -f "sudden-death/${f}"
cp hato-bot/${f} sudden-death/
done
PATTERN_BEFORE="$(grep '^click' sudden-death/Pipfile)"
PATTERN_AFTER="$(grep '^click' hato-bot/Pipfile)"
PATTERN="s/${PATTERN_BEFORE}/${PATTERN_AFTER}/g"
sed -i -e "${PATTERN}" sudden-death/Pipfile
PATTERN_AFTER="$(grep click hato-bot/pyproject.toml | sed -e 's/^.*click==\([0-9.]*\)".*$/\1/g')"
sed -i -e "s/click==[0-9.]*\"/click==${PATTERN_AFTER}\"/g" sudden-death/pyproject.toml
Loading

0 comments on commit cfc7357

Please sign in to comment.