Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another try to fix publishing #120

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
43 changes: 16 additions & 27 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,25 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip build
pip install setuptools wheel numpy
pip install setuptools wheel numpy twine
- name: Build the package
run: |
pip install .
python -m build
- name: Build wheel with cibuildwheel
run: |
pip install cibuildwheel
cibuildwheel --platform linux
env:
#it is not working with python 3.6, which is outdated and no longer supported by many modern packages, including scikit-build-core.
CIBW_SKIP: "cp36-*"
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"

#- name: Publish distribution 📦 to Test PyPI
# run: |
# twine upload --repository testpypi wheelhouse/* --verbose
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}

python -m build --sdist --wheel

- name: Publish distribution 📦 to Test PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository-url: https://test.pypi.org/legacy/

- name: Publish distribution 📦 to PyPI
run: |
twine upload --skip-existing --repository testpypi dist/*.tar.gz --verbose
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}


- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing dist/*.tar.gz --verbose
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2 changes: 1 addition & 1 deletion aurora/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "aurora"
__version__ = "3.0.1"
__version__ = "3.0.6"

import numpy as np, os

Expand Down
8 changes: 5 additions & 3 deletions aurora/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,17 @@ def reload_namelist(self, namelist=None):
# Extract one by one all the inputs from namelist
# as attributes of asim, keeping the same name
#NOTE T.O. I'm not a fan of this MATLAB approach..

for parameter in self.namelist:
if parameter == 'kin_profs':
pass
continue
elif isinstance(self.namelist[parameter], dict):
for sub_parameter in self.namelist[parameter]:
setattr(self, sub_parameter, self.namelist[parameter][sub_parameter])
if sub_parameter != 'nbi_cxr':
setattr(self, sub_parameter, self.namelist[parameter][sub_parameter])
else:
setattr(self, parameter, self.namelist[parameter])

# consistency checks for divertor parameters
if not 0.0 <= self.div_neut_screen <= 1.0:
raise ValueError("div_neut_screen must be between 0.0 and 1.0!")
Expand Down