Skip to content

Commit

Permalink
Merge pull request #42 from pnnl/ci-fixes
Browse files Browse the repository at this point in the history
Update conda recipe and actions for continuous integration
  • Loading branch information
smcolby authored Dec 18, 2024
2 parents d2f2cb9 + cf34f6d commit e235193
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 34 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ jobs:
- name: Install ISiCLE
run: pip install --no-deps .

# - name: Test environment
# run: |
# pytest
- name: Test environment
run: |
python -c "import isicle"
# pytest
Test_Mac:
needs:
Expand Down Expand Up @@ -75,10 +76,11 @@ jobs:
- name: Install ISiCLE
run: pip install --no-deps .

# - name: Test environment
# run: |
# pytest

- name: Test environment
run: |
python -c "import isicle"
# pytest
Deploy:
needs:
- Test_Linux
Expand All @@ -100,7 +102,7 @@ jobs:
miniforge-version: latest
use-mamba: true
python-version: 3.12
channels: conda-forge,bioconda
channels: conda-forge,bioconda,smcolby
use-only-tar-bz2: false
auto-activate-base: true

Expand All @@ -113,13 +115,13 @@ jobs:
mkdir build/
conda mambabuild conda-recipe/ --output-folder build/
conda index build/
- name: Convert to osx-64
run: conda convert -p osx-64 build/linux-64/*.tar.bz2 -o build/
- name: Convert to osx-arm64
run: conda convert -p osx-arm64 build/linux-64/*.tar.bz2 -o build/

- name: Upload packages
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
anaconda upload build/linux-64/*.tar.bz2
anaconda upload build/osx-64/*.tar.bz2
anaconda upload build/osx-arm64/*.tar.bz2
6 changes: 6 additions & 0 deletions conda-recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

python:
- 3.12
- 3.11
- 3.10
- 3.9
4 changes: 2 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% set data = load_setup_py_data(setup_file='../setup.py',
{% set data = load_setup_py_data(setup_file="../setup.py",
from_recipe_dir=True) %}

package:
name: isicle
version: {{ data.get('version') }}
version: {{ data.get("version") }}

source:
path: ..
Expand Down
6 changes: 3 additions & 3 deletions isicle/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _find_output_by_header(self, header):
pattern = (
r"(-{2,})\n\s{0,}("
+ re.escape(header)
+ ")\s{0,}\n-{2,}\n([\s\S]*?)(?=-{2,}\n[^\n]*\n-{2,}\n|$)"
+ r")\s{0,}\n-{2,}\n([\s\S]*?)(?=-{2,}\n[^\n]*\n-{2,}\n|$)"
)

# Search ORCA output file
Expand Down Expand Up @@ -242,8 +242,8 @@ def _parse_spin(self):

# Parse table
text = [x.strip() for x in text if x.strip() != "" and "*" not in x]
columns = [x.replace(" ", "") for x in re.split("\s{2,}", text[0])]
body = [re.split("\s{2,}", x)[1:] for x in text[1:-1]]
columns = [x.replace(" ", "") for x in re.split(r"\s{2,}", text[0])]
body = [re.split(r"\s{2,}", x)[1:] for x in text[1:-1]]

# Construct data frame
return pd.DataFrame(body, dtype=float, columns=columns, index=columns)
Expand Down
31 changes: 14 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
import os
from setuptools import setup, find_packages
import sys

sys.path.append(os.path.dirname(__file__))
with open("isicle/__init__.py") as f:
exec([x for x in f.readlines() if "__version__" in x][0])

import isicle

with open('README.md') as f:
with open("README.md") as f:
readme = f.read()

with open('LICENSE') as f:
with open("LICENSE") as f:
license = f.read()

with open('requirements.txt', 'r') as f:
with open("requirements.txt", "r") as f:
install_requires = f.read().splitlines()

pkgs = find_packages(exclude=('examples', 'docs', 'resources'))
pkgs = find_packages(exclude=("examples", "docs", "resources"))

setup(
name='isicle',
version=isicle.__version__, # TODO: switch to versioneer.get_version() or alternate method
description='ISiCLE: in silico chemical library engine',
name="isicle",
version=__version__, # TODO: switch to versioneer.get_version() or alternate method
description="ISiCLE: in silico chemical library engine",
long_description=readme,
long_description_content_type='text/markdown',
author='Sean M. Colby',
author_email='sean.colby@pnnl.gov',
long_description_content_type="text/markdown",
author="Sean M. Colby",
author_email="sean.colby@pnnl.gov",
license=license,
packages=pkgs,
python_requires=">=3.9",
Expand All @@ -33,6 +30,6 @@
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Chemistry",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License"
]
"License :: OSI Approved :: MIT License",
],
)

0 comments on commit e235193

Please sign in to comment.