Skip to content

Commit

Permalink
Update for PyPI publish.
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyChiang committed Nov 4, 2024
1 parent ec161f8 commit aac8d39
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 16 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/PyQUDA-Utils.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PyQUDA-Utils sdist
name: PyQUDA-Utils publish

on:
workflow_dispatch:
Expand All @@ -9,10 +9,17 @@ on:
default: 0.0.0

jobs:
build:
pypi-publish:

runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/PyQUDA-Utils

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -34,6 +41,8 @@ jobs:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ github.event.inputs.tag }}
files: dist/pyquda_utils-${{ github.event.inputs.tag }}.tar.gz
fail_on_unmatched_files: true

- name: Publish sdist
uses: pypa/gh-action-pypi-publish@release/v1
19 changes: 16 additions & 3 deletions .github/workflows/PyQUDA.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PyQUDA sdist
name: PyQUDA publish

on:
workflow_dispatch:
Expand All @@ -9,10 +9,17 @@ on:
default: 0.0.0

jobs:
build:
pypi-publish:

runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/PyQUDA

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -28,7 +35,7 @@ jobs:
run: python -m pip install --upgrade pip setuptools wheel Cython build

- name: Build sdist
run: cd pyquda_core && python -m build . --sdist
run: python -m build ./pyquda_core --sdist

- name: Upload sdist
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
Expand All @@ -37,3 +44,9 @@ jobs:
tag_name: v${{ github.event.inputs.tag }}
files: pyquda_core/dist/pyquda-${{ github.event.inputs.tag }}.tar.gz
fail_on_unmatched_files: true

- name: Prepare sdist
run: mv ./pyquda_core/sdist ./

- name: Publish sdist
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion example/1_Quenched_HMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from time import perf_counter

from pyquda import init
from pyquda.utils import io
from pyquda.field import LatticeInfo, LatticeGauge, Nc
from pyquda_utils import io

from hmc import HMC

Expand Down
4 changes: 2 additions & 2 deletions example/2_Quark_Propagator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from opt_einsum import contract
from matplotlib import pyplot as plt

from pyquda import init, core, LatticeInfo
from pyquda.utils import io, gamma, source
from pyquda import init, LatticeInfo
from pyquda.field import LatticePropagator, Ns, Nc
from pyquda_utils import core, io, gamma, source

init([1, 1, 1, 2], resource_path=".cache")

Expand Down
4 changes: 2 additions & 2 deletions example/3_Pion_Proton_2pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from opt_einsum import contract
from matplotlib import pyplot as plt

from pyquda import init, core, LatticeInfo
from pyquda.utils import io, gamma
from pyquda import init, LatticeInfo
from pyquda_utils import core, io, gamma

init([1, 1, 1, 2], resource_path=".cache")

Expand Down
4 changes: 2 additions & 2 deletions example/4_Pion_PCAC.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from opt_einsum import contract
from matplotlib import pyplot as plt

from pyquda import init, core, LatticeInfo
from pyquda.utils import io, gamma
from pyquda import init, LatticeInfo
from pyquda_utils import core, io, gamma

init([1, 1, 1, 2], resource_path=".cache")

Expand Down
4 changes: 2 additions & 2 deletions example/5_Pion_Dispersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from opt_einsum import contract
from matplotlib import pyplot as plt

from pyquda import init, core, LatticeInfo
from pyquda.utils import io, gamma, phase
from pyquda import init, LatticeInfo
from pyquda_utils import core, io, gamma, phase

init([1, 1, 1, 2], resource_path=".cache")

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
if describe != "":
tag, post, hash = describe.strip().split("-")
with open(os.path.join(os.path.dirname(__file__), "pyquda_utils", "_version.py"), "w") as f:
f.write(f'__version__ = "{tag[1:]}.post{post}+{hash}"\n')
f.write(f'__version__ = "{tag[1:]}.dev{post}"\n')

setup()

0 comments on commit aac8d39

Please sign in to comment.