53 Commits

Author SHA1 Message Date
Eisuke Kawashima
77530fb0aa python: replace IOError with OSError
https://peps.python.org/pep-3151/
2022-04-25 16:37:29 +09:00
Noel O'Boyle
d927b6e21a Revert the slash n change 2020-05-23 10:25:01 +01:00
Noel O'Boyle
732444b176 Support Python 2.7. Also Python 3.8. 2020-05-23 10:03:38 +01:00
Eisuke Kawashima
7bf2ec203f Update scripts/python/setup.py 2019-10-11 16:43:46 +09:00
Eisuke Kawashima
6b57788a05 Improve python script
- `from __future__ import print_function`
- replace deprecated `unittest.TestCase.assertEquals` with
  `assertEqual`, `assertTrue`, or `assertFalse`
- use `obj is None` instead of `obj == None`
- remove modules and functions that are imported but not used
2019-04-17 21:59:20 +09:00
Matt Swain
5c8165e496 Simplify OB version check in setup.py 2019-03-23 11:22:43 +00:00
Matt Swain
46c9e1f8fd Update setup.py to install into openbabel package 2019-03-21 23:56:54 +00:00
Matt Swain
d05a47ede9 Improved OB version check in setup.py 2019-03-21 23:55:23 +00:00
Matt Swain
0910928392 Simplify pkg-config wrapper in setup.py 2019-03-21 23:53:54 +00:00
Matt Swain
59792513e3 Simplify metadata in setup.py 2019-03-21 23:52:09 +00:00
Matt Swain
bd031bcaa8 Find version from __init__.py to avoid hardcoding in setup.py 2019-03-21 23:50:12 +00:00
Matt Swain
9e29155155 Simplify setup.py long_description 2019-03-21 23:48:16 +00:00
Matt Swain
1d71075f19 Fix setup.py indentation 2019-03-21 23:46:51 +00:00
Matt Swain
72be31f3fa Python setup.py fixes for 2.4.0 release
This commit contains a few minor changes to the Python setup.py file that is used for independent installation of the Python bindings.

- Version bumped to 2.4.0 to match the main Open Babel version.
- The custom install command sublcass was fixed to just call the superclass install method after the extra build_ext command. This resolved an issue with running bdist_wheel.
- `zip_safe` changed to `False`, so running `python setup.py install` behaviour is more like `pip install openbabel`.
2016-09-23 21:59:16 +01:00
Matt Swain
41337524ba Fix swig include_dirs+library_dirs in setup.py
distutils/setuptools now appear to add some default SWIG `include_dirs` and `library_dirs`, so we should append the openbabel paths to these lists rather than overwriting them entirely.
2015-08-15 18:34:49 +01:00
Matt Swain
0c368799f7 Remove duplicate swig files
- Remove the duplicate swig interface files from the `python` directory.
- Remove the rule specifying those files from `MANIFEST.in`.
- Modify `setup.py` to pull in the interface files from the parent directory when preparing the distrubution using `sdist`.
- Add the rule `exclude openbabel.py` to `MANIFEST.in`, to help prevent accidentally including a copy of the resulting swig bindings in the source distribution.
- Bump the python bindings version number to 1.8.2 to allow these changes to be pushed to PyPI.
2015-04-10 14:21:46 +01:00
Patrick Fuller
4a7966cc85 setup.py now 2/3 compatible 2014-11-02 21:42:46 -06:00
Matt Swain
668e5f8179 Bump python bindings version to 1.8.1 2014-01-28 17:02:31 +00:00
Matt Swain
9962917d9d Add more info to python README and revert package name change
Change the python bindings package name back to 'openbabel', but make clear in the Python README that this is just the python bindings, not the main Open Babel library, just in case anyone stumbles across the PyPI page by accident.
2014-01-28 10:48:59 +00:00
Matt Swain
099f67badb Change python bindings package name to openbabel-python 2014-01-24 11:11:52 +00:00
Matt Swain
e65bf4bfbc Make pkg-config check more robust and allow manual override
Add a sensible fallback if pkg-config fails to locate the Open Babel include and library directories, and a helpful error message if that fallback also fails.

Allow Open Babel include and library directories to be manually specified as command line options to setup.py using the build_ext command with -I and -L options.
2014-01-20 18:22:13 +00:00
Matt Swain
d6a44bcd40 Ensure build_ext runs before build_py
The setup.py build and install commands run a number of subcommands, including build_ext, which runs SWIG to generate openbabel.py, and build_py, which copies openbabel.py and other python sources to the build directory.

The default ordering is for build_py to be run before build_ext, causing errors as build_py attempts to copy openbabel.py before it exists. This change ensures build_ext is always run first at the start of both the build and install commands.
2014-01-20 18:07:07 +00:00
Matt Swain
b94f4b7f83 Add proper python README
- Convert README to restructuredtext format so it displays correctly on PyPI
- Update email address to current mailing list
- Tidy up setup.py
2014-01-20 17:58:42 +00:00
S. Joshua Swamidass
42335bd889 missed setup.py in last committ 2014-01-05 08:57:27 -10:00
Reinis Danne
7366f780bb setup.py: There are no separate pybel_pyX.py files anymore 2012-10-15 12:18:03 +00:00
Noel O'Boyle
fa4c9d71f0 Update the draw method of Pybel so that it uses our own depiction and 2D layout. I've removed the dependency on OASA (but added optional dependencies on cairo and pyrsvg). Once we have direct depiction on PNG I'll be able to drop the pyrsvg one. 2011-05-16 20:14:36 +00:00
Geoffrey Hutchison
0ffd9199f1 Patches from Fedora packaging. 2010-12-15 21:45:57 +00:00
Noel O'Boyle
7a83696add Update docs and Python binding version. 2010-10-26 11:37:36 +00:00
Noel O'Boyle
5e87842233 Rename pybel versions for Py 2 and 3 so that they can be imported directly during testing. Associated changes in testpybel setup.py and testbindings.py.
This fixes a problem running testbindings.py in the testsuite on Windows. (It was importing the globalling installed pybel.py)
2010-10-04 12:37:06 +00:00
Noel O'Boyle
d102bde7ad Minor fix for installing Python bindings on Linux 2010-06-01 08:36:30 +00:00
Noel O'Boyle
56b776be94 More corrections due to new location of swig outputs 2010-05-09 19:45:42 +00:00
Noel O'Boyle
5934edee4b 2010-03-13 Noel O'Boyle
* scripts/CMakeLists.txt, scripts/python/setup.py: Compile the
	SWIG bindings manually.
2010-03-13 11:57:35 +00:00
Noel O'Boyle
afb12d1eb7 2009-09-21 Noel O'Boyle <baoilleach@gmail.com>
* scripts/*: Copied + pasted the scripts directory from 22x as a number
	of commits were never merged.
2009-09-21 11:12:00 +00:00
Tim Vandermeersch
16302b65bc Merged revisions 3091-3094,3097-3100 via svnmerge from
https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/branches/openbabel-2-2-x

........
  r3091 | ghutchis | 2009-06-22 00:24:46 +0200 (Mon, 22 Jun 2009) | 5 lines
  
          * src/chains.cpp (OpenBabel): Fix for PR#2691618. When writing
          hydrogen atoms without chain names, make sure there are never
          spaces.
........
  r3092 | ghutchis | 2009-06-22 15:24:47 +0200 (Mon, 22 Jun 2009) | 4 lines
  
          * src/generic.cpp: Fix unit cell when setting possibly zero
          translation vectors ( e.g. PR#1961604).
........
  r3093 | timvdm | 2009-06-22 22:54:24 +0200 (Mon, 22 Jun 2009) | 2 lines
  
  Fix phmodel.txt rules to match both free & polymerized amino acids.
........
  r3094 | ghutchis | 2009-06-24 00:06:49 +0200 (Wed, 24 Jun 2009) | 2 lines
  
  Updated from Tim's recent change.
........
  r3097 | ghutchis | 2009-06-24 21:26:55 +0200 (Wed, 24 Jun 2009) | 2 lines
  
  Added Craig's changes for randomized SMILES order.
........
  r3098 | ghutchis | 2009-06-25 05:36:47 +0200 (Thu, 25 Jun 2009) | 4 lines
  
          * src/generic.cpp (OBUnitCell): Make sure to set the space group
          to P1 by default and after FillUnitCell.
........
  r3099 | ghutchis | 2009-06-25 05:36:56 +0200 (Thu, 25 Jun 2009) | 6 lines
  
          * src/formats/mopacformat.cpp: Read and write translation vectors,
          if available.
  
          * src/formats/gaussformat.cpp: Ditto
........
  r3100 | ghutchis | 2009-06-25 20:14:18 +0200 (Thu, 25 Jun 2009) | 2 lines
  
  Fix PR#2784880 -- compiling with OPENBABEL_INSTALL set fails (e.g., on MacPorts).
........
2009-07-18 09:55:34 +00:00
Tim Vandermeersch
967ec60730 Merged revisions 3071,3073-3080 via svnmerge from
https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/branches/openbabel-2-2-x

........
  r3071 | baoilleach | 2009-06-18 11:08:17 +0200 (Thu, 18 Jun 2009) | 1 line
  
  bump python scripting to 1.5
........
  r3073 | ghutchis | 2009-06-19 21:17:13 +0200 (Fri, 19 Jun 2009) | 2 lines
  
  Fix typo in FOR_RINGS_OF_MOL macro.
........
  r3074 | ghutchis | 2009-06-19 23:09:34 +0200 (Fri, 19 Jun 2009) | 6 lines
  
          * src/kekulize.cpp (expandcycle): Fix PR#2705497. Kekulize has
          problems with fused aromatic rings joined by a non-aromatic
          ring. Make sure when expanding aromatic cycles that we only accept
          atoms which are in the *same* ring from OBMol::GetSSSR().
........
  r3075 | ghutchis | 2009-06-20 00:27:22 +0200 (Sat, 20 Jun 2009) | 2 lines
  
  Fix for PR#1814248.
........
  r3076 | ghutchis | 2009-06-20 14:51:29 +0200 (Sat, 20 Jun 2009) | 6 lines
  
          * src/kekulize.cpp (expandcycle): Rewritten as cleaner recursive
          function. Look for largest possible aromatic cycle. Fixes more
          bugs, but still has issues with "figure 8" ring systems,
          e.g. c12n(nnn1)cccc2.
........
  r3077 | ghutchis | 2009-06-20 14:51:51 +0200 (Sat, 20 Jun 2009) | 3 lines
  
          * test/*: Update with recent changes.
........
  r3078 | ghutchis | 2009-06-20 16:57:32 +0200 (Sat, 20 Jun 2009) | 5 lines
  
          * src/kekulize.cpp (expandcycle): Rewritten as cleaner recursive
          function. Look for largest possible aromatic cycle, including
          handling fused "figure 8" ring systems.
........
  r3079 | ghutchis | 2009-06-20 16:57:45 +0200 (Sat, 20 Jun 2009) | 3 lines
  
          * test/*: Update with recent changes.
........
  r3080 | ghutchis | 2009-06-20 17:16:47 +0200 (Sat, 20 Jun 2009) | 2 lines
  
  More fixes -- use Noel's atom precidence. Fixes problems with azole rings with pyrrole vs. pyridynyl atoms.
........
2009-07-18 09:26:46 +00:00
Noel O'Boyle
625a89e365 * Reverted r2535 except for changes to scripts/perl/Makefile.PL
* scripts/openbabel-python.i: Updated SWIG interface file to ignore 21 methods of each std::vector created. This should substantially reduce the size of the wrapper code
2008-06-17 19:03:50 +00:00
Geoffrey Hutchison
024240cd78 Split python bindings into multiple pieces. Should solve PR#1905826. 2008-06-05 22:42:47 +00:00
Noel O'Boyle
79b8f3db20 Pybel: Synching with cinfony, and getting ready for release as 1.3 2008-05-23 08:19:28 +00:00
Noel O'Boyle
78915a732b Error in my previous commit. 2008-04-01 10:33:11 +00:00
Noel O'Boyle
e160ab259a Fix for MacOSX to allow compilation of Python bindings against local build tree. 2008-03-31 12:43:41 +00:00
Noel O'Boyle
24ccf30c1b Updating perl wrapper to the same as Python. Fixing setup.py for Python as wasn't finding openbabel.so on my system 2008-01-29 09:38:22 +00:00
Geoffrey Hutchison
858f8a39f9 * Merged in changes from 2.1.x branch. 2007-09-03 20:53:06 +00:00
Geoffrey Hutchison
08f782aea6 * scripts/python/setup.py, scripts/perl/Makefile.PL: Updates from
Rathann Mierzejewski to check for src/.libs directories. Prevents
  "chicken and egg" problem with what component is built first.
2006-12-18 21:00:58 +00:00
Geoffrey Hutchison
0afe511e34 * include/openbabel: New directory for public headers. Ensures
internal and external code use the same 
  #include <openbabel/header.h> syntax.
2006-12-10 13:56:00 +00:00
Noel O'Boyle
71b835bcad * scripts/python/setup.py, pyopenbabel.py, testpyopenbabel.py,
pyopenbabelapi.html: Changed all references to pyopenbabel to 
pybel
        (new name). Also, corrected minor typo in docstring in pybel.py.
2006-11-18 13:31:04 +00:00
Geoffrey Hutchison
32e8d6d627 Merged changes from 2.0.1 fixes that were not already integrated into 2.1. 2006-04-19 15:37:47 +00:00
Noel O'Boyle
8caaa288f5 Reverted rename of the created extension from _openbabel.so to openbabel.so. 2006-03-16 15:18:59 +00:00
Geoffrey Hutchison
ffa5441823 * scripts/*: Build updates for Perl and Python wrappers. 2006-03-14 00:47:39 +00:00
Noel O'Boyle
ce597aeb68 Modified setup.py to also install pyopenbabel. 2006-02-21 09:33:24 +00:00
Noel O'Boyle
a3a65728b5 setup.py can now find the relevant libraries, whereever they are! 2005-12-16 11:18:14 +00:00