Skip to content

Commit 3ad689f

Browse files
authored
Updated version (#4)
1 parent f47ab3c commit 3ad689f

File tree

3 files changed

+39
-30
lines changed

3 files changed

+39
-30
lines changed

.github/workflows/publish-pypi.yml

+38-27
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,43 @@
1-
name: Publish to PyPI
2-
1+
name: Publish to Pypi - Fairlens_pe
32
on:
4-
release:
5-
types: [published]
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Version to upload to pypi'
7+
required: true
8+
pypi_repo:
9+
description: 'Repo to upload to (testpypi or pypi)'
10+
default: 'testpypi'
11+
required: true
612

713
jobs:
8-
build-and-publish:
14+
publish:
915
runs-on: ubuntu-latest
1016
steps:
11-
- name: Checkout tag
12-
uses: actions/checkout@v2
13-
with:
14-
fetch-depth: 0
15-
ref: ${{ github.event.release.tag_name }}
16-
17-
- name: Set up Python 3.11
18-
uses: actions/setup-python@v1
19-
with:
20-
python-version: 3.11
21-
22-
- name: Install pypa/build
23-
run: python -m pip install build --user
24-
25-
- name: Build wheel and source dist
26-
run: python -m build --sdist --wheel --outdir dist/ .
27-
28-
- name: Publish to PyPI
29-
uses: pypa/gh-action-pypi-publish@release/v1
30-
with:
31-
user: __token__
32-
password: ${{ secrets.PYPI_API_TOKEN }}
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-python@v3
19+
with:
20+
python-version: '3.11'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install wheel
25+
- name: Update version.txt
26+
run: echo "${{ github.event.inputs.version }}" > version.txt
27+
- name: Build package
28+
run: python setup.py sdist bdist_wheel
29+
env:
30+
VERSION: ${{ github.event.inputs.version }}
31+
- name: Publish package to TestPyPI
32+
uses: pypa/[email protected]
33+
with:
34+
user: __token__
35+
password: ${{ secrets.TEST_PYPI_TOKEN }}
36+
repository_url: https://test.pypi.org/legacy/
37+
if: ${{ github.event.inputs.pypi_repo == 'testpypi' }}
38+
- name: Publish package to PyPI
39+
uses: pypa/[email protected]
40+
with:
41+
user: __token__
42+
password: ${{ secrets.PYPI_TOKEN }}
43+
if: ${{ github.event.inputs.pypi_repo == 'pypi' }}

pyproject.toml

-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
requires = [
33
"setuptools>=45",
44
"wheel",
5-
"setuptools_scm[toml]>=6.0"
65
]
76
build-backend = "setuptools.build_meta"
87

9-
[tool.setuptools_scm]
10-
write_to = "src/fairlens/version.py"
118

129
[tool.black]
1310
line-length = 120

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ classifiers =
1818
Operating System :: MacOS
1919
Intended Audience :: Developers
2020
Intended Audience :: Science/Research
21+
version = 0.2.0
2122

2223
[options]
2324
package_dir =

0 commit comments

Comments
 (0)