Files
openbabel/openbabel-3.1.1-test-python3-imports.patch
Martin Pluskal b71a8dcf47 Accepting request 998728 from home:1Antoine1:branches:science
- Update to version 3.1.1:
  * Fixes for packaging.
  * No features or significant bug fixes were involved.
- Changes from version 3.1.0:
  * This version represents additional API and is
    backwards-compatible with the 3.0 release.
  * For a full list of changes, see:
    https://open-babel.readthedocs.io/en/latest/ReleaseNotes/ob310.html
- Changes from version 3.0.0:
  * This release represents a major update and is strongly
    recommended for all users.
  * It also removes deprecated components and breaks the API in a
    few places. For information on migrating from the previous
    version, please see:
    https://open-babel.readthedocs.io/en/latest/UseTheLibrary/migration.html#migrating-to-3-0
  * A sample of major new features:
    + Code for handling implicit hydrogens and kekulization has
      been entirely replaced. As well as being accurate, the new
      approach is much faster.
    + Speed of reading and writing SMILES has been improved by
      more  than 50-fold.
    + Removal of the old 'babel' binary in favor of the newer
      'obabel' command-line tool.
    + New improved fragment-based 3D coordinate generation code.
    + New API for handling reactions stored as molecules (e.g.
      Reaction InChI, etc.).
    + New API for copying part of an OBMol as a substructure.
    + Support for Maestro file format.
  * For a full list of changes, see:
    https://open-babel.readthedocs.io/en/latest/ReleaseNotes/ob300.html
- Remove upstreamed patches:
  * fix_narrowing.patch
  * fix_yasara.patch
- Add patches:
  * openbabel-3.1.1-test-python3-escape-chars.patch: Fix python
    test failure (gh#openbabel/openbabel#2217).
  * openbabel-3.1.1-test-python3-imports.patch: Fix ImportError in
    python tests (gh#openbabel/openbabel!2378).
  * openbabel-3.1.1-version-number.patch: Fix version number.
  * openbabel-3.1.1-gcc-12.patch: Fix build with GCC 12
    (gh#openbabel/openbabel!2493).
  * openbabel-3.1.1-wx-stl-compat.patch: Fix GUI build against
    wxWidgets compiled with STL (gh#openbabel/openbabel!2527).
- Build against system's inchi library instead of the bundled one.
- Add maeparser-devel as build dependency: Needed for Maestro
  support.
- Update subpackages:
  * Compile and package GUI.
  * Move plugins from CLI package (i.e. main package) to library
    package: They should be available to other library clients
    without requiring the CLI tools.
  * Move data files from CLI package to library package: Some are
    required by the library, some are required by its plugins,
    let's move everything to library package for now.
- Drop __DATE__ and __TIME__ tweaks for reproducibility: These GCC
  macros now use SOURCE_DATE_EPOCH.
- Enable tests.

OBS-URL: https://build.opensuse.org/request/show/998728
OBS-URL: https://build.opensuse.org/package/show/science/openbabel?expand=0&rev=16
2022-08-23 09:01:53 +00:00

45 lines
1.8 KiB
Diff

From 4ba2fec17b786afebadfae800a015704ad533843 Mon Sep 17 00:00:00 2001
From: dkoes <dkoes@pitt.edu>
Date: Mon, 7 Jun 2021 11:04:25 -0400
Subject: [PATCH] Resolve ImportError with make test
This change will build _openbabel.so in scripts/python/openbabel instead
of the default build/lib. This is necessary because openbabel.py tries
to import _openbabel like this:
if __package__ or "." in __name__:
from . import _openbabel
else:
import _openbabel
This results in a circular import error when running make test (the
first branch of the if is triggered). This code appears to be generated by
SWIG with no obvious way to change it to catch the ImportError and call
import _openbabel instead. Note the PYTHONPATH is set to include
build/lib, but it doesn't matter because SWIG is forcing the import to
happen in scripts/python/openbabel.
I'm not sure why this hasn't been a problem in the past, perhaps there's
been a change in SWIG. This is with SWIG 4.0.1 and cmake 3.18.6.
I think the best solution is to move all the files that are being built
in /scripts to the build directory rather than polluting the src tree
with them, but this would require changing all the bindings and I'm not
up for building and testing every binding.
---
scripts/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index b715a546dd..56821641fe 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -106,6 +106,7 @@ if (DO_PYTHON_BINDINGS)
set_target_properties(bindings_python PROPERTIES
OUTPUT_NAME _openbabel
PREFIX ""
+ LIBRARY_OUTPUT_DIRECTORY "${openbabel_SOURCE_DIR}/scripts/python/openbabel/"
SUFFIX .so )
execute_process(
COMMAND