Skip to content

Commit 61e0a0f

Browse files
committed
Add github workflows tests
1 parent e7ff6ee commit 61e0a0f

File tree

4 files changed

+83
-2
lines changed

4 files changed

+83
-2
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI and Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# Only trigger for changes inside portpy/
8+
paths:
9+
- 'portpy/**'
10+
pull_request:
11+
# Only trigger for PRs touching portpy/
12+
paths:
13+
- 'portpy/**'
14+
release:
15+
types: [published]
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.12"
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install .[test]
32+
33+
- name: Run tests
34+
run: pytest -v --maxfail=1 --disable-warnings
35+
36+
publish:
37+
runs-on: ubuntu-latest
38+
needs: test
39+
if: github.event_name == 'release' && github.event.action == 'published'
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Set up Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: "3.12"
47+
48+
- name: Install build tools
49+
run: |
50+
python -m pip install --upgrade pip
51+
pip install build twine
52+
53+
- name: Build package
54+
run: python -m build
55+
56+
- name: Publish to PyPI
57+
env:
58+
TWINE_USERNAME: __token__
59+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
60+
run: twine upload dist/*

LICENSE.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,24 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.
202+
203+
======================================================================
204+
Commons Clause License Condition v1.0
205+
206+
The Software is provided to you by the Licensor under the License, as defined below,
207+
subject to the following condition:
208+
209+
Without limiting other conditions in the License, the grant of rights under the
210+
License will not include, and the License does not grant to you, the right to Sell
211+
the Software.
212+
213+
For purposes of the foregoing, “Sell” means practicing any or all of the rights
214+
granted to you under the License to provide to third parties, for a fee or other
215+
consideration (including without limitation fees for hosting or consulting/support
216+
services related to the Software), a product or service whose value derives,
217+
entirely or substantially, from the functionality of the Software.
218+
219+
Any license notice or attribution required by the License must also include this
220+
Commons Clause License Condition notice.
221+
======================================================================

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
</h2>
1111

12-
![Version](https://img.shields.io/static/v1?label=latest&message=v1.1.1&color=darkgreen)
12+
![PyPI version](https://img.shields.io/pypi/v/portpy?color=darkgreen&label=latest)
1313
[![Total Downloads](https://static.pepy.tech/personalized-badge/portpy?period=total&units=international_system&left_color=grey&right_color=blue&left_text=total%20downloads)](https://pepy.tech/project/portpy?&left_text=totalusers)
1414
[![Monthly Downloads](https://static.pepy.tech/badge/portpy/month)](https://pepy.tech/project/portpy)
1515

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,5 @@ pythonpath = ["."]
7373
mosek = ["Mosek>=9.3.14"]
7474
pydicom = ["pydicom>=2.2.0"]
7575
all = ["Mosek>=9.3.14", "pydicom>=2.2.0", "websocket-client>=1.8.0", "visdom>=0.2.4", "dominate>=2.6.0", "torch>=2.7.0", "torchfile>=0.1.0", "torchvision>=0.9.1", "huggingface-hub>=0.34.3"]
76+
test = ["pytest>=8.0", "huggingface-hub>=0.34.3"]
7677
ai = ["websocket-client>=1.8.0", "visdom>=0.2.4", "dominate>=2.6.0", "torch>=2.7.0", "torchfile>=0.1.0", "torchvision>=0.9.1"]

0 commit comments

Comments
 (0)