Skip to content

Commit 746d511

Browse files
authored
Merge pull request #57 from kozistr/build/poetry
[Build] pipenv to poetry
2 parents 6ba157d + a9247fe commit 746d511

File tree

12 files changed

+768
-620
lines changed

12 files changed

+768
-620
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
python-version: ['3.7', '3.8', '3.9']
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
- name: set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v3
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222
- name: cache pip

.github/workflows/publish.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515
- name: Create Release
1616
id: create_release
1717
uses: actions/create-release@v1
@@ -27,21 +27,16 @@ jobs:
2727
needs: release
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v2
31-
- name: Setup Python 3.8
32-
uses: actions/setup-python@v2
30+
- uses: actions/checkout@v3
31+
- name: Setup Python 3.9
32+
uses: actions/setup-python@v3
3333
with:
34-
python-version: 3.8
34+
python-version: 3.9
3535
- name: Install dependencies
36-
run: |
37-
python3 -m pip install -r requirements.txt
38-
python3 -m pip install -U wheel twine
39-
- name: Build package
40-
run: |
41-
make build
36+
run: python3 -m pip install -r requirements.txt
4237
- name: Publish package to PyPI
43-
run: |
44-
make deploy
4538
env:
46-
TWINE_USERNAME: __token__
47-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
39+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
40+
run: |
41+
poetry config pypi-token.pypi $PYPI_TOKEN
42+
poetry publish --build

Makefile

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
.PHONY: init format test check build deploy requirements
1+
.PHONY: init format test check requirements
22

33
init:
4-
python3 -m pip install -U pipenv setuptools
5-
python3 -m pipenv install --dev
4+
python -m pip install -U poetry
5+
python -m poetry install
66

77
format:
8-
isort --profile black -l 119 pytorch_optimizer tests setup.py lint.py
9-
black -S -l 119 pytorch_optimizer tests setup.py lint.py
8+
isort --profile black -l 119 pytorch_optimizer tests lint.py
9+
black -S -l 119 pytorch_optimizer tests lint.py
1010

1111
test:
12-
python3 -m pytest -sv -vv --cov=pytorch_optimizer --cov-report=xml ./tests
12+
python -m pytest -sv -vv --cov=pytorch_optimizer --cov-report=xml ./tests
1313

1414
check:
15-
isort --check-only --profile black -l 119 pytorch_optimizer tests setup.py lint.py
16-
black -S -l 119 --check pytorch_optimizer tests setup.py lint.py
17-
python3 lint.py
18-
19-
build:
20-
python3 setup.py sdist bdist_wheel
21-
22-
deploy:
23-
python3 -m twine check dist/*
24-
python3 -m twine upload dist/*
15+
isort --check-only --profile black -l 119 pytorch_optimizer tests lint.py
16+
black -S -l 119 --check pytorch_optimizer tests lint.py
17+
python lint.py
2518

2619
requirements:
27-
python3 -m pipenv lock -r > requirements.txt
28-
python3 -m pipenv lock -dr > requirements-dev.txt
20+
python -m poetry export -f requirements.txt --output requirements.txt --without-hashes
21+
python -m poetry export --dev -f requirements.txt --output requirements-dev.txt --without-hashes

Pipfile

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

Pipfile.lock

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

0 commit comments

Comments
 (0)