Skip to content
## New Features

* cmmnbuild-dep-manager can now manage type stub generation for JPype based Java code.
  A command, ``python -m cmmnbuild_dep_manager stubgen`` was added to allow this from the command line.
  This functionality is an optional extra and must be enabled with ``pip install cmmnbuild-dep-manager[stubgen]``.
  With generated stubs, tools such as ``mypy`` can do static analysis on your code and detect incorrect usage of a Java library accessed with JPype.
  A significant benefit is that you will also get tab completion and an improved development experience in an IDE such as PyCharm.
  See Michi's PjLSA talk at https://indico.cern.ch/event/938422/#4-pjlsa-jpype for a demonstration of the concept.

* The CBNG JAR resolution implementation has been rewritten to use the [new cbng-web service](https://gitlab.cern.ch/acc-co/devops/cbng/cbng-web) running at https://acc-py-repo.cern.ch/cbng-web-resolver/resolve/productxml.
  The new service mirrors the GET & POST behaviour of the previous CGI based cbng-web service.
  * This new implementation supports the ability to resolve the Java environment without necessarily downloading the JARs, and allows ``cmmnbuild-dep-manager`` to download the individual JARs directly from ``artifactory.cern.ch``.
     * Downloading of JARs is now done in parallel, and is able to skip downloading of JARs that it has already downloaded previously.

* ``cmmnbuild-dep-manager`` now has the ability to resolve a Java environment to a file, and to install/download JARs defined in the file; this is good for versioning your environment, much like a ``requirements.txt`` (this is the mechanism employed by [acc-py-deploy](https://gitlab.cern.ch/acc-co/devops/python/acc-py-deploy)). See [``Manager.lockfile_generate``](https://acc-py.web.cern.ch/gitlab/scripting-tools/cmmnbuild-dep-manager/docs/stable/api/cmmnbuild_dep_manager.Manager.lockfile_generate.html#cmmnbuild_dep_manager.Manager.lockfile_generate) and [``Manager.lockfile_install``](https://acc-py.web.cern.ch/gitlab/scripting-tools/cmmnbuild-dep-manager/docs/stable/api/cmmnbuild_dep_manager.Manager.lockfile_install.html#cmmnbuild_dep_manager.Manager.lockfile_install) for more details.
  Note that it is not yet possible to generate a lockfile from an *existing* environment.


## Bug fixes

* There are several known issues with JPype v1.x which are addressed with this release of ``cmmnbuild-dep-manager``
  * [An issue with numpy/OpenBLAS & JPype/JNI](https://github.com/jpype-project/jpype/issues/808) interacting poorly and causing a segmentation fault when doing linear algebra in numpy is worked around ([scripting-tools/cmmnbuild-dep-manager!69](https://gitlab.cern.ch/scripting-tools/cmmnbuild-dep-manager/-/merge_requests/69))

  * An issue with Java libraries which don't correctly clear up non-daemon threads upon termination is worked around in this release of ``cmmnbuild-dep-manager`` by calling ``System.exit`` a defined period after the final termination of Python itself. This is particularly relevant for JAPC users, where some connections are being held indefinitely unless forced to stop in this way (https://issues.cern.ch/browse/JAPC-1014).

  * An issue where Python & Java aren't cooperating well with interrupt signals has been addressed by adding the ``-Xrs`` flag to JVM startup. This flag was previously set for JPype ``v0.x`` and means that libraries such as PyQt are now able to be interrupted as expected. See [scripting-tools/cmmnbuild-dep-manager!70](https://gitlab.cern.ch/scripting-tools/cmmnbuild-dep-manager/-/merge_requests/70) for more details.

* The instantiation of a Manager will no longer configure the root logger, and instead only sets up a log handler for ``cmmnbuild-dep-manager`` logs if the root logger has not been previously configured. ([scripting-tools/cmmnbuild-dep-manager!52](https://gitlab.cern.ch/scripting-tools/cmmnbuild-dep-manager/-/merge_requests/52))

* ``cmmnbuild-dep-manager`` will now correctly unregister packages which have been manually registered and which are unimportable ([scripting-tools/cmmnbuild-dep-manager!55](https://gitlab.cern.ch/scripting-tools/cmmnbuild-dep-manager/-/merge_requests/55))

* The minimum version of ``JPype`` is now 1.1, and significant test coverage has been added to ensure that ``cmmnbuild-dep-manager`` works with the supported versions.

* API documentation has been added at https://acc-py.web.cern.ch/gitlab/scripting-tools/cmmnbuild-dep-manager/docs/stable

* The module ``cmmnbuild_dep_manager.cmmnbuild_dep_manager`` has been removed as it is redundant and incorrect. ``Manager`` can be accessed from ``cmmnbuild_dep_manager.Manager``.