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

fix: update python configuration #139

Merged
merged 18 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
# python-version: [ '3.7', '3.8', '3.9', '3.10' ]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -47,7 +48,7 @@ jobs:

# BioSimulators
- name: Build BioSimulators Docker image
if: matrix.python-version == '3.9'
if: matrix.python-version >= '3.9'
run: |
cp build/smoldyn*.whl scripts/
cd scripts
Expand All @@ -56,18 +57,19 @@ jobs:
--tag ghcr.io/ssandrews/smoldyn/biosimulators_smoldyn:latest \
.
- name: Lint BioSimulators
if: matrix.python-version == '3.9'
if: matrix.python-version >= '3.9'
run: |
python -m pip install --upgrade pip
python -m pip install flake8
flake8 source/python/smoldyn/biosimulators/ --ignore E501,W503
- name: Install BioSimulators
if: matrix.python-version == '3.9'
if: matrix.python-version >= '3.9'
run: |
cd build
WHEEL_PATH=$(ls smoldyn*.whl)
python -m pip install --force-reinstall "${WHEEL_PATH}[biosimulators,biosimulators-tests]"
- name: Test BioSimulators
if: matrix.python-version == '3.9'
if: matrix.python-version >= '3.9'
run: |
python -m pip install pytest flaky
xvfb-run --auto-servernum python -m pytest tests/test_biosimulators.py --verbose
3 changes: 2 additions & 1 deletion .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
# python-version: [ '3.7', '3.8', '3.9', '3.10' ]

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
# python-version: [ '3.7', '3.8', '3.9', '3.10' ]
steps:
- uses: actions/checkout@v2
- name: "Setup Python ${{ matrix.python-version }}"
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ endif ()

if (OPTION_PYTHON)
# Find python before using pybind11. There is a possibility of version mismatch later.
find_package(Python3 3.10 EXACT COMPONENTS Interpreter Development REQUIRED)
# find_package(Python3 3.10 EXACT COMPONENTS Interpreter Development REQUIRED)
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
set(PYBIND11_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source/pybind11)
add_subdirectory(${PYBIND11_SOURCE_DIR})
add_subdirectory(${CMAKE_SOURCE_DIR}/source/python)
Expand Down
4 changes: 3 additions & 1 deletion scripts/Dockerfile-BioSimulators
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ LABEL \
extra.identifiers.biotools="smoldyn" \
maintainer="Steven Andrews <[email protected]>"

# Set up headless environment
RUN apt-get -y update \
&& apt-get install --no-install-recommends -y \
xvfb \
libxrender1 \
libgl1-mesa-glx \
libfreetype6 \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /tmp/.X11-unix \
&& chmod 1777 /tmp/.X11-unix
Expand Down
3 changes: 2 additions & 1 deletion scripts/build_wheels_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ for PYDIR in $PYDIR311 $PYDIR310 $PYDIR39 $PYDIR38 $PYDIR37; do
)
done

PYTHON=$PYDIR38/bin/python
# PYTHON=$PYDIR38/bin/python
PYTHON=$PYDIR39/bin/python
$PYTHON -m pip install twine

ls -lh $WHEELHOUSE/*.whl
Expand Down
2 changes: 2 additions & 0 deletions source/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# python binding.

# find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module Development.Embed VERSION 3.8.15...3.12)

# recompile libsmoldyn for PYTHON.
add_library(_pysmoldyn STATIC ${SRC_FILES}
$<TARGET_OBJECTS:Steve>
Expand Down
2 changes: 1 addition & 1 deletion source/python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ setuptools.setup(
"biosimulators-utils[logging]>=0.1.124",
"numpy",
"pandas",
"biosimulators-simularium>=0.5.27"
"biosimulators-simularium>=0.5.29"
],
"biosimulators-dev": [
"flake8",
Expand Down
6 changes: 2 additions & 4 deletions source/python/smoldyn/biosimulators/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

def test_simularium():
archive_path = '/Users/alex/Desktop/uchc_work/repos/Smoldyn/examples/S99_more/Min/Min1.omex'
output_dir = '/Users/alex/Desktop/uchc_work'
# output_dir = '/Users/alex/Desktop/uchc_work'
output_dir = temp_dir()

exec_archive(archive_path, output_dir)
files = [f for f in os.listdir(output_dir)]
Expand All @@ -18,8 +19,5 @@ def test_simularium():
print(f'THE SIMULARIUM:\n{data}')





if __name__ == '__main__':
test_simularium()
Loading