Skip to content

Commit 79c524e

Browse files
authored
Merge pull request #163 from kurusugawa-computer/pipenv-to-poetry
pipenvからpoetryに移行する
2 parents a8aa344 + 6dc9878 commit 79c524e

15 files changed

+1192
-780
lines changed

.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
max-line-length = 120
3+
4+
# formatter 'black'と競合するため、チェックを無視する
5+
# https://black.readthedocs.io/en/stable/the_black_code_style.html#line-length
6+
extend-ignore = E203, W503
7+
8+

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ install:
99
- echo -e "machine annofab.com\nlogin FOO\npassword BAR\n" > ~/.netrc && chmod 600 ~/.netrc
1010
script:
1111
- flake8 annofabapi
12-
- mypy annofabapi --config-file setup.cfg
13-
- pylint annofabapi --rcfile setup.cfg
12+
- mypy annofabapi
13+
- pylint annofabapi
1414
- pytest tests/test_local*.py
1515
branches:
1616
only:

Makefile

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,26 @@
11
.PHONY: docs lint test format test publish_test publish
22

33
init:
4-
pip install pipenv --upgrade
5-
# blackをpipenvでなくpipでインストールする理由:
6-
# 2020/04時点でblackはベータ版で、pipenvでblackを利用するにはPipfileに`allow_prereleases=true`を記載する必要がある。
7-
# Pipfileに`allow_prereleases=true`を設定すると、black以外のプレリリース版(ベータ版)もインストールされてしまうが、これは避けたいのでblackはpipでインストールする
8-
pip install black --upgrade
9-
pipenv install --dev
4+
pip install poetry --upgrade
5+
poetry install
106

117
format:
12-
pipenv run autoflake --in-place --remove-all-unused-imports --ignore-init-module-imports --recursive annofabapi tests
13-
# balckは正式版がリリースされるまでは、pipenv上で実行しない。事前にpipでblackをインストールすること。
14-
pipenv run isort --verbose --recursive annofabapi tests
15-
black annofabapi tests
8+
poetry run autoflake --in-place --remove-all-unused-imports --ignore-init-module-imports --recursive annofabapi tests
9+
poetry run isort --verbose --recursive annofabapi tests
10+
poetry run black annofabapi tests
1611

1712
lint:
18-
pipenv run mypy annofabapi --config-file setup.cfg
19-
pipenv run flake8 annofabapi
20-
pipenv run pylint annofabapi --rcfile setup.cfg
13+
poetry run mypy annofabapi
14+
poetry run flake8 annofabapi
15+
poetry run pylint annofabapi
2116

2217
test:
23-
pipenv run pytest -n auto --cov=annofabapi --cov-report=html tests
24-
25-
publish_test:
26-
rm -fr build/ dist/ annofabapi.egg-info
27-
pipenv run python setup.py check --strict
28-
pipenv run python setup.py sdist bdist_wheel
29-
pipenv run twine upload dist/* --repository-url https://test.pypi.org/legacy/ --verbose
30-
rm -fr build/ dist/ annofabapi.egg-info
18+
poetry run pytest -n auto --cov=annofabapi --cov-report=html tests
3119

3220
publish:
33-
rm -fr build/ dist/ annofabapi.egg-info
34-
pipenv run python setup.py check --strict
35-
pipenv run python setup.py sdist bdist_wheel
36-
pipenv run twine upload dist/* --repository-url https://upload.pypi.org/legacy/ --verbose
37-
rm -fr build/ dist/ annofabapi.egg-info
21+
poetry publish --build
3822

3923
docs:
40-
cd docs && pipenv run make html
24+
cd docs && poetry run make html
4125
@echo "\033[95m\n\nBuild successful! View the docs homepage at docs/_build/html/index.html.\n\033[0m"
4226

Pipfile

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

Pipfile.lock

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

README_for_developer.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
* Bash
77
* Docker (OpenAPI Generatorを実行するのに必要)
88
* python 3.6+
9-
* [pipenv](https://pipenv.pypa.io/en/latest/)
9+
* poetry
1010

1111
## Install
12-
以下のコマンドを実行してください。開発に必要なpipenvがインストールされます
12+
以下のコマンドを実行してください。開発に必要な環境が構築されます
1313

1414
```bash
1515
$ make init
@@ -54,17 +54,17 @@ $ make lint
5454
#### 直接pytestを実行する場合
5555

5656
```
57-
$ pipenv run pytest tests
57+
$ poetry run pytest tests
5858
```
5959

6060
annofabapiでは、pytestのカスタムオプションを定義しています。
6161

6262
```
6363
# ジョブを投げるテスト(時間がかかるテスト)を実行する。
64-
$ pipenv run pytest --run_submitting_job tests
64+
$ poetry run pytest --run_submitting_job tests
6565
6666
# annofabapiモジュールのログを表示する。
67-
$ pipenv run pytest --print_log_annofabapi tests
67+
$ poetry run pytest --print_log_annofabapi tests
6868
```
6969

7070
#### カバレッジの確認

annofabapi/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.33.0"
1+
__version__ = "0.33.1"

generate/generate.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,7 @@ rm -Rf out/openapi_client
241241
cd ../
242242

243243
# Format
244-
FORMATTED_FILE="annofabapi/generated_api.py annofabapi/generated_api2.py annofabapi/models.py annofabapi/dataclass/*.py"
245-
pipenv run autoflake --in-place --remove-all-unused-imports --ignore-init-module-imports --recursive ${FORMATTED_FILE}
246-
pipenv run isort --verbose --recursive ${FORMATTED_FILE}
247-
black ${FORMATTED_FILE}
244+
make format
248245

249246
popd
250247

generate/swagger/swagger.v2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ info:
8686
入力データセットID | 組織内で一意
8787
プラグインID | 組織内で一意
8888
89-
version: 0.85.0
89+
version: 0.86.0
9090
title: AnnoFab Web API
9191
x-logo:
9292
url: "https://annofab.com/images/logo_landscape.png"

generate/swagger/swagger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ info:
8686
入力データセットID | 組織内で一意
8787
プラグインID | 組織内で一意
8888
89-
version: 0.85.0
89+
version: 0.86.0
9090
title: AnnoFab Web API
9191
x-logo:
9292
url: "https://annofab.com/images/logo_landscape.png"

mypy.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[mypy]
2+
ignore_missing_imports = True

0 commit comments

Comments
 (0)