Skip to content

Commit c1ce1c5

Browse files
committed
small fixes for OSX
1 parent 144126e commit c1ce1c5

File tree

5 files changed

+19
-25
lines changed

5 files changed

+19
-25
lines changed

README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# vmd-python
22
Installable VMD as a python module
33

4-
*NEW*: Version 3.0 has the following new features
4+
*NEW*: Support for new arm64 macs!
5+
6+
Version 3.0 has the following new features
57

68
* Atomselection attributes can be accessed or set more easily:
79
`atomsel.get("x")` can be written as `atomsel.x`!
@@ -12,8 +14,6 @@ Installable VMD as a python module
1214
* More rigorous reference counting / fewer memory leaks
1315
* Much prettier code
1416

15-
*NEW*: Support for Python 3!!!
16-
1717
![CI status](https://img.shields.io/travis/Eigenstate/vmd-python.svg)
1818
![Downloads](https://anaconda.org/rbetz/vmd-python/badges/downloads.svg)
1919
![Conda](https://anaconda.org/rbetz/vmd-python/badges/installer/conda.svg)
@@ -105,7 +105,7 @@ The easiest way to install the module is by using the [Conda](https://conda.io/e
105105
Python package manager. Vmd-python is in the [conda forge](https://conda-forge.org/)
106106
channel:
107107

108-
Simple binary installation with conda (currently linux-x86\_64 only)
108+
Simple binary installation with conda:
109109

110110
conda install -c conda-forge vmd-python
111111

@@ -136,21 +136,16 @@ and `libopengl0` packages. To build:
136136

137137
Please file issues if you have problems with this!!
138138

139-
### OSX support
140-
141-
Users have reported that on OSX with Tcl/Tk 8.6 the module will
142-
segfault on import. Unfortunately I'm the only developer of this software and
143-
don't have access to a machine running OSX with which to debug the issue.
144-
145139
## Dependencies
146140
vmd-python has the following dependencies:
147141

148-
* python 2.7 or 3.6
142+
* python>2.7 or>3.6
149143
* numpy
150144
* libnetcdf >= 4.3
151145
* expat
152146
* sqlite
153-
* Tcl/Tk = 8.5 (8.6 will crash on OSX)
147+
* Tcl/Tk
148+
* importlib_resources
154149

155150
To build on Debian, that's the following packages:
156151

test/test_vmd.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Tests covalently bonded ligand
22
import inspect
3-
import pytest
43
import os
54

5+
import pytest
6+
67
dir = os.path.dirname(__file__)
78

89
#==============================================================================
@@ -22,20 +23,20 @@ def test_caps_import():
2223
#==============================================================================
2324

2425
def test_load_mae(file_rho):
25-
from vmd import molecule, atomsel
26+
from vmd import atomsel, molecule
2627
assert callable(atomsel)
2728

2829
molecule.load('mae', file_rho)
29-
chrg = set(atomsel().get('charge'))
30+
chrg = set(atomsel().charge)
3031
assert chrg == set([0.0, 1.0, -1.0])
3132

32-
ins = set(atomsel().get('insertion'))
33+
ins = set(atomsel().insertion)
3334
assert set(_.strip() for _ in ins) == set(['', 'A'])
3435

3536
#==============================================================================
3637

3738
def test_evaltcl(file_rho):
38-
from vmd import evaltcl, atomsel, molecule
39+
from vmd import atomsel, evaltcl, molecule
3940

4041
molid = int(evaltcl("mol new"))
4142
assert molecule.get_top() == molid

vmd/install.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ export VMDINSTALLBINDIR="$VMDDIR"
1313
export VMDINSTALLLIBRARYDIR="$VMDDIR"
1414
export PLUGINDIR="$VMDDIR/plugins"
1515

16-
# Clean up previous installation
17-
if [[ -d $PLUGINDIR ]]; then
18-
echo "Deleting previous plugin directory $PLUGINDIR"
19-
rm -r $PLUGINDIR
20-
fi
21-
2216
# Compile the plugins
2317
echo "Compiling plugins to $PLUGINDIR"
2418
mkdir -p $PLUGINDIR
@@ -57,7 +51,7 @@ cd $vmd_src/plugins
5751
make clean
5852

5953
# Remove symlink so install doesn't freak out
60-
rm $vmd_src/vmd_src/plugins
54+
rm -f $vmd_src/vmd_src/plugins
6155

6256
# Copy init.py file into build directory
6357
cp "$vmd_src/vmd_src/__init__.py" "$VMDDIR"

vmd/vmd_src/configure

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,6 +2168,9 @@ if ($config_arch eq "MACOSXX86" || $config_arch eq "MACOSXX86_64" || $config_arc
21682168
} else {
21692169
$arch_lopts .= "";
21702170
}
2171+
if ($config_shared) {
2172+
$arch_cppopts .= " -DVMD_SHARED";
2173+
}
21712174

21722175
# Mesa version uses X11 just like other Unix versions,
21732176
# but the OpenGL version uses native MacOS X, no X11.

vmd/vmd_src/python/Molecule.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
from vmd import molecule, molrep
2929

30+
3031
class Molecule:
3132
"""
3233
The Molecule class is a proxy for molecules loaded into VMD. Most
@@ -91,7 +92,7 @@ def _guessFiletype(self, filename):
9192
if ind >= 0:
9293
filetype = filename[ind+1:]
9394
else:
94-
if len(filename) is 4:
95+
if len(filename) == 4:
9596
filetype = 'webpdb'
9697
return filetype
9798

0 commit comments

Comments
 (0)