Skip to content

Commit b999c60

Browse files
removing some async part (#75)
* removing some async part
1 parent 593a531 commit b999c60

11 files changed

Lines changed: 562 additions & 544 deletions

File tree

.github/actions/prepare-poetry/action.yml

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

.github/workflows/ci-publish-test-repo.yml

Lines changed: 30 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -4,111 +4,57 @@
44
##
55
---
66

7+
name: Publish test-pypi
8+
79
on:
810
push:
911
branches:
1012
- main
1113
pull_request:
1214

1315
jobs:
14-
build:
15-
name: Build distribution
16+
build-and-publish:
17+
name: Build and Publish to TestPyPI
1618
runs-on: ubuntu-latest
17-
steps:
1819

19-
- name: Checkout code
20+
steps:
21+
- name: 📥 Checkout repository
2022
uses: actions/checkout@v4
2123
with:
22-
fetch-depth: 0
24+
fetch-depth: 0 # Fetch the entire history to avoid shallow repository issues
2325

24-
- name: Set up Python
26+
- name: 🐍 Set up Python
2527
uses: actions/setup-python@v4
2628
with:
27-
python-version: '3.9'
28-
29-
- name: Install Poetry
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install poetry
33-
pip install poetry-dynamic-versioning
34-
35-
- name: Build
36-
run: |
37-
poetry build
29+
python-version: "3.9"
3830

39-
- name: Save build artifacts
40-
uses: actions/upload-artifact@v4
31+
- name: 💾 Cache Poetry dependencies
32+
uses: actions/cache@v3
4133
with:
42-
name: dist-artifact
43-
path: dist/
34+
path: ~/.cache/pypoetry
35+
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
36+
restore-keys: |
37+
poetry-${{ runner.os }}-
4438
45-
test:
46-
name: Test
47-
needs: build
48-
runs-on: ubuntu-latest
49-
steps:
50-
51-
- name: Set up Python
52-
uses: actions/setup-python@v4
39+
- name: 📦 Install poetry
40+
uses: abatilo/actions-poetry@v4
5341
with:
54-
python-version: '3.9'
42+
poetry-version: '2.1.1'
5543

56-
- name: Checkout code
57-
uses: actions/checkout@v4
58-
with:
59-
fetch-depth: 0
60-
61-
- name: Get build artifacts
62-
uses: actions/download-artifact@v4
63-
with:
64-
name: dist-artifact
65-
path: dist/
44+
- name: 📦 Install poetry-dynamic-versioning
45+
run: poetry self add "poetry-dynamic-versioning[plugin]"
6646

67-
- name: Install from build
68-
run: |
69-
python -m pip install --upgrade pip
70-
pip install pytest-mock
71-
pip install etpproto --pre --target=dist --find-links=dist/
47+
- name: 📥 Install dependencies
48+
run: poetry install --no-interaction --no-root
7249

73-
- name: Copy tests and example data to dist folder for testing against artifacts
50+
- name: Configure Poetry with PyPI repository and token
7451
run: |
75-
cp -R tests dist/
76-
# cp -R example_data dist/
77-
78-
- name: Run tests
79-
run: pytest dist/tests
80-
81-
publish:
82-
name: Publish to PyPI
83-
needs: [build, test]
84-
runs-on: ubuntu-latest
85-
steps:
52+
poetry config repositories.test-pypi https://test.pypi.org/legacy/
53+
poetry config pypi-token.test-pypi ${{ secrets.POETRY_PYPI_TEST_TOKEN_VALUE }}
8654
87-
- name: Set up Python
88-
uses: actions/setup-python@v4
89-
with:
90-
python-version: '3.9'
55+
- name: 🛠️ Build the package
56+
run: poetry build
9157

92-
# Retrieve the code and GIT history so that poetry-dynamic-versioning knows which version to upload
93-
- name: Checkout code
94-
uses: actions/checkout@v4
95-
with:
96-
fetch-depth: 0
97-
98-
- name: Get build artifacts
99-
uses: actions/download-artifact@v4
100-
with:
101-
name: dist-artifact
102-
path: dist/
103-
104-
- name: Install Poetry
105-
run: |
106-
python -m pip install --upgrade pip
107-
pip install poetry
108-
pip install poetry-dynamic-versioning
109-
110-
- name: Upload to PyPI TEST
111-
run: |
112-
poetry config repositories.test https://test.pypi.org/legacy/
113-
poetry config http-basic.test ${{ secrets.POETRY_PYPI_TOKEN_USERNAME}} ${{ secrets.POETRY_TEST_PYPI_TOKEN_PASSWORD}}
114-
poetry publish --repository test
58+
- name: 🚀 Publish to PyPI
59+
run:
60+
poetry publish --repository test-pypi

.github/workflows/ci-publish.yml

Lines changed: 24 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -11,103 +11,42 @@ on:
1111
types: [published]
1212

1313
jobs:
14-
build:
15-
name: Build distribution
14+
build-and-publish:
15+
name: Build and Publish
1616
runs-on: ubuntu-latest
17-
steps:
1817

19-
- name: Checkout code
18+
steps:
19+
- name: 📥 Checkout repository
2020
uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
2321

24-
- name: Set up Python
22+
- name: 🐍 Set up Python
2523
uses: actions/setup-python@v4
2624
with:
27-
python-version: '3.9'
28-
29-
- name: Install Poetry
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install poetry
33-
pip install poetry-dynamic-versioning
34-
35-
- name: Build
36-
run: |
37-
poetry build
38-
39-
- name: Save build artifacts
40-
uses: actions/upload-artifact@v4
41-
with:
42-
name: dist-artifact
43-
path: dist/
44-
45-
test:
46-
name: Test
47-
needs: build
48-
runs-on: ubuntu-latest
49-
steps:
25+
python-version: "3.9"
5026

51-
- name: Set up Python
52-
uses: actions/setup-python@v4
27+
- name: 💾 Cache Poetry dependencies
28+
uses: actions/cache@v3
5329
with:
54-
python-version: '3.9'
30+
path: ~/.cache/pypoetry
31+
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
32+
restore-keys: |
33+
poetry-${{ runner.os }}-
5534
56-
- name: Checkout code
57-
uses: actions/checkout@v4
35+
- name: 📦 Install poetry
36+
uses: abatilo/actions-poetry@v4
5837
with:
59-
fetch-depth: 0
38+
poetry-version: '2.1.1'
6039

61-
- name: Get build artifacts
62-
uses: actions/download-artifact@v4
63-
with:
64-
name: dist-artifact
65-
path: dist/
40+
- name: 📦 Install poetry-dynamic-versioning
41+
run: poetry self add "poetry-dynamic-versioning[plugin]"
6642

67-
- name: Install from build
68-
run: |
69-
python -m pip install --upgrade pip
70-
pip install pytest-mock
71-
pip install etpproto --pre --target=dist --find-links=dist/
43+
- name: 📥 Install dependencies
44+
run: poetry install --no-interaction --no-root
7245

73-
- name: Copy tests and example data to dist folder for testing against artifacts
74-
run: |
75-
cp -R tests dist/
76-
# cp -R example_data dist/
77-
78-
- name: Run tests
79-
run: pytest dist/tests
80-
81-
publish:
82-
name: Publish to PyPI
83-
needs: [build, test]
84-
runs-on: ubuntu-latest
85-
steps:
86-
87-
- name: Set up Python
88-
uses: actions/setup-python@v4
89-
with:
90-
python-version: '3.9'
91-
92-
# Retrieve the code and GIT history so that poetry-dynamic-versioning knows which version to upload
93-
- name: Checkout code
94-
uses: actions/checkout@v4
95-
with:
96-
fetch-depth: 0
97-
98-
- name: Get build artifacts
99-
uses: actions/download-artifact@v4
100-
with:
101-
name: dist-artifact
102-
path: dist/
103-
104-
- name: Install Poetry
105-
run: |
106-
python -m pip install --upgrade pip
107-
pip install poetry
108-
pip install poetry-dynamic-versioning
46+
- name: 🛠️ Build the package
47+
run: poetry build
10948

110-
- name: Upload to PyPI
49+
- name: 🚀 Publish to PyPI
11150
run: |
112-
poetry config repositories.test https://test.pypi.org/legacy/
113-
poetry publish --username ${{ secrets.POETRY_PYPI_TOKEN_USERNAME}} --password ${{ secrets.POETRY_PYPI_TOKEN_PASSWORD}}
51+
poetry config pypi-token.pypi ${{ secrets.POETRY_PYPI_TOKEN_PASSWORD }}
52+
poetry publish

0 commit comments

Comments
 (0)