-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from pyiron/main
Merge main
- Loading branch information
Showing
31 changed files
with
316 additions
and
2,427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- nbsphinx | ||
- sphinx | ||
- myst-parser | ||
- numpy | ||
- mpi4py | ||
- pympipool | ||
- ase | ||
- scipy | ||
- nbsphinx | ||
- sphinx | ||
- myst-parser | ||
- numpy | ||
- mpi4py | ||
- pympipool | ||
- ase | ||
- scipy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
channels: | ||
- conda-forge | ||
- conda-forge | ||
dependencies: | ||
- coverage | ||
- lammps =2023.08.02 | ||
- mpich | ||
- numpy =1.26.0 | ||
- mpi4py =3.1.4 | ||
- pympipool =0.7.1 | ||
- ase =3.22.1 | ||
- scipy =1.11.3 | ||
- coverage | ||
- lammps =2024.02.07 | ||
- mpich | ||
- numpy =1.26.4 | ||
- mpi4py =3.1.5 | ||
- pympipool =0.7.17 | ||
- ase =3.22.1 | ||
- scipy =1.13.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- lammps =2022.06.23 | ||
- openmpi | ||
- numpy =1.23.5 | ||
- mpi4py =3.1.4 | ||
- pympipool =0.7.0 | ||
- ase =3.20.1 | ||
- scipy =1.9.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
channels: | ||
- conda-forge | ||
- conda-forge | ||
dependencies: | ||
- coverage | ||
- lammps =2023.08.02 | ||
- openmpi | ||
- numpy =1.26.0 | ||
- mpi4py =3.1.4 | ||
- pympipool =0.7.1 | ||
- ase =3.22.1 | ||
- scipy =1.11.3 | ||
- coverage | ||
- lammps =2024.02.07 | ||
- openmpi | ||
- numpy =1.26.4 | ||
- mpi4py =3.1.5 | ||
- pympipool =0.7.17 | ||
- ase =3.22.1 | ||
- scipy =1.13.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
def get_setup_version_and_pattern(setup_content): | ||
depend_lst, version_lst = [], [] | ||
for l in setup_content: | ||
if '==' in l: | ||
lst = l.split('[')[-1].split(']')[0].replace(' ', '').replace('"', '').replace("'", '').split(',') | ||
for dep in lst: | ||
if dep != '\n': | ||
version_lst.append(dep.split('==')[1]) | ||
depend_lst.append(dep.split('==')[0]) | ||
|
||
version_high_dict = {d: v for d, v in zip(depend_lst, version_lst)} | ||
return version_high_dict | ||
|
||
|
||
def get_env_version(env_content): | ||
read_flag = False | ||
depend_lst, version_lst = [], [] | ||
for l in env_content: | ||
if 'dependencies:' in l: | ||
read_flag = True | ||
elif read_flag: | ||
lst = l.replace('-', '').replace(' ', '').replace('\n', '').split("=") | ||
if len(lst) == 2: | ||
depend_lst.append(lst[0]) | ||
version_lst.append(lst[1]) | ||
return {d:v for d, v in zip(depend_lst, version_lst)} | ||
|
||
|
||
def update_dependencies(setup_content, version_low_dict, version_high_dict): | ||
version_combo_dict = {} | ||
for dep, ver in version_high_dict.items(): | ||
if dep in version_low_dict.keys() and version_low_dict[dep] != ver: | ||
version_combo_dict[dep] = dep + ">=" + version_low_dict[dep] + ",<=" + ver | ||
else: | ||
version_combo_dict[dep] = dep + "==" + ver | ||
|
||
setup_content_new = "" | ||
pattern_dict = {d:d + "==" + v for d, v in version_high_dict.items()} | ||
for l in setup_content: | ||
for k, v in pattern_dict.items(): | ||
if v in l: | ||
l = l.replace(v, version_combo_dict[k]) | ||
setup_content_new +=l | ||
return setup_content_new | ||
|
||
|
||
if __name__ == "__main__": | ||
with open('pyproject.toml', "r") as f: | ||
setup_content = f.readlines() | ||
|
||
with open('environment.yml', "r") as f: | ||
env_content = f.readlines() | ||
|
||
setup_content_new = update_dependencies( | ||
setup_content=setup_content[2:], | ||
version_low_dict=get_env_version(env_content=env_content), | ||
version_high_dict=get_setup_version_and_pattern(setup_content=setup_content[2:]), | ||
) | ||
|
||
with open('pyproject.toml', "w") as f: | ||
f.writelines("".join(setup_content[:2]) + setup_content_new) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,41 @@ | ||
# This workflow is used to upload and deploy a new release to PyPi | ||
# Based on https://github.com/pypa/gh-action-pypi-publish | ||
|
||
name: PyPi Release | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
# based on https://github.com/pypa/gh-action-pypi-publish | ||
jobs: | ||
build: | ||
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/${{ github.event.repository.name }} | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v4 | ||
- uses: conda-incubator/setup-miniconda@v2.2.0 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install dependencies | ||
run: >- | ||
python -m pip install --user --upgrade setuptools wheel | ||
python-version: 3.11 | ||
mamba-version: "*" | ||
channels: conda-forge | ||
miniforge-variant: Mambaforge | ||
channel-priority: strict | ||
auto-update-conda: true | ||
environment-file: .ci_support/environment-openmpi.yml | ||
- name: Convert dependencies | ||
run: >- | ||
sed -i 's/==/>=/g' setup.py; cat setup.py | ||
run: | | ||
cp .ci_support/environment-old.yml environment.yml | ||
python .ci_support/release.py; cat pyproject.toml | ||
- name: Build | ||
run: >- | ||
shell: bash -l {0} | ||
run: | | ||
pip install versioneer[toml]==0.29 | ||
python setup.py sdist bdist_wheel | ||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Unittest Lower Bound | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: '3.9' | ||
miniforge-variant: Mambaforge | ||
channels: conda-forge | ||
channel-priority: strict | ||
use-mamba: true | ||
environment-file: .ci_support/environment-old.yml | ||
- name: Test | ||
shell: bash -l {0} | ||
timeout-minutes: 5 | ||
run: | | ||
pip install versioneer[toml]==0.29 | ||
pip install . --no-deps --no-build-isolation | ||
python -m unittest discover tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.