Skip to content

Commit

Permalink
Merge branch 'cmake' into cmake_win
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrettSJohnson committed May 12, 2024
2 parents 0990fd3 + 33f1735 commit e3540b2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 22 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
shell: cmd
run: |-
CALL %CONDA_ROOT%\\Scripts\\activate.bat
conda install -y -c conda-forge -c schrodinger python cmake libpng freetype pyqt glew libxml2 numpy catch2=2.13.3 glm libnetcdf collada2gltf pytest
conda install -y -c conda-forge -c schrodinger python cmake libpng freetype pyqt glew libxml2 numpy catch2=2.13.3 glm libnetcdf collada2gltf biopython pillow msgpack-python pytest
- name: Conda info
shell: cmd
Expand All @@ -84,27 +84,28 @@ jobs:
shell: cmd
run: |
git clone --depth 1 https://github.com/rcsb/mmtf-cpp.git
cp -R mmtf-cpp/include/mmtf* include/
cp -R mmtf-cpp/include/mmtf* %CONDA_ROOT%/Library/include/
git clone --depth 1 --single-branch --branch cpp_master https://github.com/msgpack/msgpack-c.git
cp -R msgpack-c/include/msgpack* %CONDA_ROOT%/Library/include/
- name: Build PyMOL
shell: cmd
run: |
CALL %CONDA_ROOT%\\Scripts\\activate.bat
python setup.py --testing install --prefix=install-prefix
python setup.py --testing install --prefix=%GITHUB_WORKSPACE%\\install-prefix
- name: Test
shell: cmd
run: |
CALL %CONDA_ROOT%\\Scripts\\activate.bat
install-prefix\\Scripts\\pymol.bat -ckqy testing\\testing.py --run all
%GITHUB_WORKSPACE%\\install-prefix\\Scripts\\pymol.bat -ckqy testing\\testing.py --run all
build-MacOS:

runs-on: macos-latest

env:
CONDA_ROOT: "/tmp/miniconda"
MAMBAFORGE_EXEC: ${{github.workspace}}\..\tmp\mambaforge.exe

steps:
- uses: actions/[email protected]
Expand All @@ -114,21 +115,23 @@ jobs:
bash $CONDA_ROOT.sh -b -p $CONDA_ROOT
export PATH="$CONDA_ROOT/bin:$PATH"
conda config --set quiet yes
conda install -y -c conda-forge -c schrodinger python cmake libpng freetype pyqt glew libxml2 numpy catch2=2.13.3 glm libnetcdf collada2gltf pytest
conda install -y -c conda-forge -c schrodinger python cmake libpng freetype pyqt glew libxml2 numpy catch2=2.13.3 glm libnetcdf collada2gltf biopython pillow msgpack-python pytest
conda info
- name: Get additional sources
run: |
git clone --depth 1 https://github.com/rcsb/mmtf-cpp.git
cp -R mmtf-cpp/include/mmtf* include/
cp -R mmtf-cpp/include/mmtf* ${CONDA_ROOT}/include/
git clone --depth 1 --single-branch --branch cpp_master https://github.com/msgpack/msgpack-c.git
cp -R msgpack-c/include/msgpack* ${CONDA_ROOT}/include/
- name: Build PyMOL
run: |-
export MACOSX_DEPLOYMENT_TARGET=12.0
export PATH="$CONDA_ROOT/bin:$PATH"
python setup.py install --prefix=install-prefix
python setup.py install --prefix=${GITHUB_WORKSPACE}/install-prefix
- name: Test
run: |-
export PATH="$CONDA_ROOT/bin:$PATH"
./install-prefix/bin/pymol -ckqy testing/testing.py --run all
${GITHUB_WORKSPACE}/install-prefix/bin/pymol -ckqy testing/testing.py --run all
2 changes: 1 addition & 1 deletion layer2/ObjectMolecule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,7 @@ static ObjectMolecule *ObjectMoleculeReadTOPStr(PyMOLGlobals * G, ObjectMolecule
*/

if(ok && isNew)
ok &= ObjectMoleculeConnect(I, cset, false);
ok = ObjectMoleculeConnect(I, cset, false);
if(cset->Symmetry && (!I->Symmetry)) {
I->Symmetry.reset(new CSymmetry(*cset->Symmetry));
CHECKOK(ok, I->Symmetry);
Expand Down
24 changes: 14 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,18 @@ def is_conda_env():

def guess_msgpackc():
for prefix in prefix_path:
f = os.path.join(prefix, 'include', 'msgpack', 'version_master.h')
for suffix in ['h', 'hpp']:
f = os.path.join(prefix, 'include', 'msgpack', f'version_master.{suffix}')

try:
m = re.search(r'MSGPACK_VERSION_MAJOR\s+(\d+)', open(f).read())
except EnvironmentError:
continue
try:
m = re.search(r'MSGPACK_VERSION_MAJOR\s+(\d+)', open(f).read())
except EnvironmentError:
continue

if m is not None:
major = int(m.group(1))
if major > 1:
return 'c++11'
if m is not None:
major = int(m.group(1))
if major > 1:
return 'c++11'

return 'no'

Expand Down Expand Up @@ -451,7 +452,10 @@ def make_launch_script(self):
def_macros += [("_PYMOL_NO_MSGPACKC", None)]
else:
if options.use_msgpackc == 'c++11':
def_macros += [("MMTF_MSGPACK_USE_CPP11", None)]
def_macros += [
("MMTF_MSGPACK_USE_CPP11", None),
("MSGPACK_NO_BOOST", None),
]
else:
libs += ['msgpackc']

Expand Down
14 changes: 12 additions & 2 deletions testing/tests/api/externing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
from pymol import cmd, testing, stored

def touch(filename):
Expand All @@ -9,8 +10,17 @@ class TestExterning(testing.PyMOLTestCase):
def testCdLsPwd(self):
with testing.mkdtemp() as path:
cmd.cd(path)
self.assertEqual(os.getcwd(),
os.path.realpath(path))
if sys.platform == 'win32':
import ctypes
def get_long_path_name(path):
buf = ctypes.create_unicode_buffer(260)
ctypes.windll.kernel32.GetLongPathNameW(path, buf, len(buf))
return buf.value
self.assertEqual(get_long_path_name(os.getcwd()),
get_long_path_name(os.path.realpath(path)))
else:
self.assertEqual(os.getcwd(),
os.path.realpath(path))

touch('foo1.txt')
touch('foo2.txt')
Expand Down

0 comments on commit e3540b2

Please sign in to comment.