Skip to content

Commit d0337b9

Browse files
Merge pull request #22 from transloadit/feature/switch-to-poetry
Switch to poetry
2 parents 67e22cb + bf564ea commit d0337b9

4 files changed

Lines changed: 1502 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ jobs:
1919
python-version: ${{ matrix.python-version }}
2020
architecture: x64
2121

22+
- name: Install Poetry manager
23+
run: pip install --upgrade poetry
24+
2225
- name: Install Dependencies
23-
run: pip install -e .[test]
26+
run: poetry install
2427

2528
- name: Test with pytest
2629
run: |
27-
pytest --cov=transloadit tests
30+
poetry run pytest --cov=transloadit tests

RELEASE.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,48 @@ This is a Howto guide on the commands to run and files to update in order to pub
44

55
### Prerequisite
66

7-
You need to have `twine`, `pypandoc`, and `pandoc` installed.
7+
Poetry will handle things for us. You need to configure poetry with your pypi token for the publishing process to work.
8+
9+
Enable testing publishing on pypi test index.
810

911
```bash
10-
pip install twine
11-
pip install pypandoc
12+
poetry config repositories.test-pypi https://test.pypi.org/legacy/
13+
poetry config pypi-token.test-pypi pypi-XXXXX
1214
```
1315

14-
To Install `pandoc` please [see](https://pandoc.org/installing.html).
16+
To setup your token to publish to pypi.
1517

16-
Pypandoc and Pandoc are needed to convert the readme from markdown to rst for the package's documentation page on [Pypi](https://pypi.org/project/pytransloadit/).
18+
```bash
19+
poetry config pypi-token.pypi pypi-XXXXX`````
20+
```
1721

1822
### Release Steps
1923

2024
1. Update the changelog, the version file, and the test file as done in [this commit](https://github.com/transloadit/python-sdk/commit/35789c535bd02086ff8f3a07eda9583d6e676d4d) and push it to main.
21-
2. Publish to Pypi by running the following commands.
22-
25+
2. Update the version
2326
```bash
24-
python setup.py sdist bdist_wheel
25-
twine check dist/*
26-
twine upload dist/*
27+
# e.g: 0.2.2 -> 0.2.3a0
28+
poetry version prerelease
29+
# or the following for, e.g.: 0.2.3
30+
poetry version patch
2731
```
32+
3. Publish to Pypi
2833

29-
The second command above (`twine check dist/*`) is meant to check for errors in the dist build, so please abort and try to fix issues if you see any errors from running the command.
34+
Pypi test index
3035

31-
Running the third command from above will prompt you for your [Pypi](https://pypi.org/project/pytransloadit/) username and password.
36+
```bash
37+
poetry build
38+
poetry publish -r test-pypi
39+
```
40+
41+
To publish to pypi
42+
```bash
43+
poetry publish
44+
```
3245

33-
3. Now that release has been published on Pypi, please head to GitHub to [draft a new tag release](https://github.com/transloadit/python-sdk/releases). Point this tag release to the latest commit pushed on step 1 above. Once you're done drafting the release, go ahead to publish it.
46+
4. Now that release has been published on Pypi, please head to GitHub to [draft a new tag release](https://github.com/transloadit/python-sdk/releases). Point this tag release to the latest commit pushed on step 1 above. Once you're done drafting the release, go ahead to publish it.
3447
35-
If all the steps above have been followed without errors, then you've successfully published a relaease. 🎉
48+
If all the steps above have been followed without errors, then you've successfully published a release. 🎉
3649

3750
---
3851

0 commit comments

Comments
 (0)