rustworkx-utils 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,40 @@
1
+ # .github/workflows/ci.yml
2
+ name: CI
3
+
4
+ on:
5
+ push:
6
+ branches: [ main ]
7
+ pull_request:
8
+ branches: [ main ]
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ python-version: ['3.10']
16
+
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+
20
+ - name: Set up Python ${{ matrix.python-version }}
21
+ uses: actions/setup-python@v4
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+
25
+ - name: Install dependencies
26
+ run: |
27
+ sudo apt-get update
28
+ python -m pip install --upgrade pip
29
+ pip install virtualenv
30
+ python -m virtualenv venv
31
+ source venv/bin/activate
32
+ pip install -r requirements-dev-ci.txt
33
+ pip install pytest mypy flake8 black isort
34
+ pip install .
35
+
36
+ - name: Run tests
37
+ run: |
38
+ source venv/bin/activate
39
+ cd test
40
+ pytest
@@ -0,0 +1,137 @@
1
+ name: Publish Python distribution to PyPI and TestPyPI
2
+ on:
3
+ push:
4
+ tags:
5
+ - 'v*' # Only run when pushing tags like v1.2.3
6
+ # branches:
7
+ # - main # Tag must be on main
8
+ jobs:
9
+ build:
10
+ name: Build distribution
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0 # needed to see tags
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.x"
21
+
22
+ - name: Install pypa/build
23
+ run: >-
24
+ python3 -m
25
+ pip install
26
+ build
27
+ --user
28
+
29
+ - name: Set version from tag
30
+ run: |
31
+ TAG="${GITHUB_REF#refs/tags/}" # e.g., v0.2.9
32
+ VERSION="${TAG#v}" # remove leading 'v'
33
+ echo "Detected version: $VERSION"
34
+
35
+ # Update __version__ in your package
36
+ sed -i "s/^__version__ = .*/__version__ = \"$VERSION\"/" src/rustworkx_utils/__init__.py
37
+
38
+ - name: Clean old builds
39
+ run: rm -rf dist build *.egg-info
40
+
41
+ - name: Build a binary wheel and a source tarball
42
+ run: python3 -m build
43
+
44
+ - name: Store the distribution packages
45
+ uses: actions/upload-artifact@v4
46
+ with:
47
+ name: python-package-distributions
48
+ path: dist/
49
+
50
+ publish-to-pypi:
51
+ name: >-
52
+ Publish Python distribution to PyPI
53
+ # if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
54
+ needs:
55
+ - build
56
+ runs-on: ubuntu-latest
57
+ environment:
58
+ name: pypi
59
+ url: https://pypi.org/p/rustworkx_utils # Replace <package-name> with your PyPI project name
60
+ permissions:
61
+ id-token: write # IMPORTANT: mandatory for trusted publishing
62
+
63
+ steps:
64
+ - name: Download all the dists
65
+ uses: actions/download-artifact@v4
66
+ with:
67
+ name: python-package-distributions
68
+ path: dist/
69
+ - name: Publish distribution to PyPI
70
+ uses: pypa/gh-action-pypi-publish@release/v1
71
+
72
+ # github-release:
73
+ # name: >-
74
+ # Sign the Python distribution with Sigstore
75
+ # and upload them to GitHub Release
76
+ # needs:
77
+ # - publish-to-pypi
78
+ # runs-on: ubuntu-latest
79
+ #
80
+ # permissions:
81
+ # contents: write # IMPORTANT: mandatory for making GitHub Releases
82
+ # id-token: write # IMPORTANT: mandatory for sigstore
83
+ #
84
+ # steps:
85
+ # - name: Download all the dists
86
+ # uses: actions/download-artifact@v3
87
+ # with:
88
+ # name: python-package-distributions
89
+ # path: dist/
90
+ # - name: Sign the dists with Sigstore
91
+ # uses: sigstore/gh-action-sigstore-python@v2.1.1
92
+ # with:
93
+ # inputs: >-
94
+ # ./dist/*.tar.gz
95
+ # ./dist/*.whl
96
+ # - name: Create GitHub Release
97
+ # env:
98
+ # GITHUB_TOKEN: ${{ github.token }}
99
+ # run: >-
100
+ # gh release create
101
+ # '${{ github.ref_name }}'
102
+ # --repo '${{ github.repository }}'
103
+ # --notes ""
104
+ # - name: Upload artifact signatures to GitHub Release
105
+ # env:
106
+ # GITHUB_TOKEN: ${{ github.token }}
107
+ # # Upload to GitHub Release using the `gh` CLI.
108
+ # # `dist/` contains the built packages, and the
109
+ # # sigstore-produced signatures and certificates.
110
+ # run: >-
111
+ # gh release upload
112
+ # '${{ github.ref_name }}' dist/**
113
+ # --repo '${{ github.repository }}'
114
+
115
+ # publish-to-testpypi:
116
+ # name: Publish Python distribution to TestPyPI
117
+ # needs:
118
+ # - build
119
+ # runs-on: ubuntu-latest
120
+ #
121
+ # environment:
122
+ # name: testpypi
123
+ # url: https://test.pypi.org/p/ripple_down_rules
124
+ #
125
+ # permissions:
126
+ # id-token: write #mandatory for trusted publishing
127
+ #
128
+ # steps:
129
+ # - name: Download all the dists
130
+ # uses: actions/download-artifact@v4
131
+ # with:
132
+ # name: python-package-distributions
133
+ # path: dist/
134
+ # - name: Publish distribution to TestPyPI
135
+ # uses: pypa/gh-action-pypi-publish@release/v1
136
+ # with:
137
+ # repository-url: https://test.pypi.org/legacy/