Updated Python wrapper on PyPI

39 views
Skip to first unread message

Oliver Stueker

unread,
Sep 9, 2025, 4:42:35 PMSep 9
to PLUMED users
Hi, 

I noticed that the Python wrapper for PLUMED on PyPI hasn't been updated since the 2.9.0 release in 2023.

I want to install recent versions of PLUMED into our software stack for the Canadian HPC Infrastructure for which we install Python bindings for several versions of Python, so that one PLUMED module can be combined with several Python modules allowing a more flexible workflow for our users.

When trying to install the plumed-2.9.0.tar.gz bindings from PyPI while using Python 3.13 I get errors like "plumed.c:48774:27: error: too few arguments to function ‘_PyLong_AsByteArray’" which from what I can tell are due to an API change in Python 3.13 (see full traceback below).

I see that the "plumed.c" in that source release was "Generated by Cython 0.29.34" (released a few months before Cython 3.0.0).
According to this issue this should be resolved with using newer versions of Cython.

Would you please upload new versions (3.9.4 and 3.10.0) of the Python bindings that use a newer Cython (~3.1.x) to PyPI?

Thanks,
Oliver

$ CFLAGS=" -w " pip install plumed
Looking in links: /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/gentoo2023/x86-64-v3, /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/gentoo2023/generic, /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/generic
Collecting plumed
  Using cached plumed-2.9.0.tar.gz (293 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: plumed
  Building wheel for plumed (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for plumed (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [56 lines of output]
      /tmp/pip-build-env-_c6bxmm3/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'test_suite'
        warnings.warn(msg)
      /tmp/pip-build-env-_c6bxmm3/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!

              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:

              License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

      !!
        self._finalize_license_expression()
      Module name plumed
      Version number 2.9.0
      using available plumed.c file
      running bdist_wheel
      running build
      running build_ext
      building 'plumed' extension
      creating build/temp.linux-x86_64-cpython-313
      gcc -w -fPIC -I./include -I/home/stuekero/easybuild-easyconfigs/easybuild/easyconfigs/p/PLUMED/venv_3.13/include -I/cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/python/3.13.2/include/python3.13 -c plumed.c -o build/temp.linux-x86_64-cpython-313/plumed.o -D_
_PLUMED_HAS_DLOPEN -D__PLUMED_WRAPPER_LINK_RUNTIME=1 -D__PLUMED_WRAPPER_IMPLEMENTATION=1 -D__PLUMED_WRAPPER_EXTERN=0
      plumed.c: In function ‘__Pyx_PyInt_As_size_t’:
      plumed.c:48774:27: error: too few arguments to function ‘_PyLong_AsByteArray’
      48774 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
            |                           ^~~~~~~~~~~~~~~~~~~
      In file included from /cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/python/3.13.2/include/python3.13/longobject.h:107,
                       from /cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/python/3.13.2/include/python3.13/Python.h:81,
                       from plumed.c:31:
      /cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/python/3.13.2/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~
      plumed.c: In function ‘__Pyx_PyInt_As_int’:
      plumed.c:49008:27: error: too few arguments to function ‘_PyLong_AsByteArray’
      49008 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
            |                           ^~~~~~~~~~~~~~~~~~~
      /cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/python/3.13.2/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~
      plumed.c: In function ‘__Pyx_PyInt_As_long’:
      plumed.c:49204:27: error: too few arguments to function ‘_PyLong_AsByteArray’
      49204 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
            |                           ^~~~~~~~~~~~~~~~~~~
      /cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/python/3.13.2/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~
      plumed.c: In function ‘__Pyx_PyInt_As_char’:
      plumed.c:49400:27: error: too few arguments to function ‘_PyLong_AsByteArray’
      49400 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
            |                           ^~~~~~~~~~~~~~~~~~~
      /cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/python/3.13.2/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~
      error: command '/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3/usr/x86_64-pc-linux-gnu/gcc-bin/12/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for plumed

Giovanni Bussi

unread,
Sep 11, 2025, 9:46:42 AMSep 11
to plumed...@googlegroups.com
Hi,

I updated the release on pypi now. Can you please cross check that it works now?

Thanks!

Giovanni


--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/plumed-users/992375ab-26f2-4952-80f6-a09ee2745bd5n%40googlegroups.com.

Oliver Stueker

unread,
Sep 11, 2025, 2:52:16 PMSep 11
to PLUMED users
Hi all,

I've figured out that while having modules for python/3.13 and cython/3.1.2 loaded, 
I can:

$ tar -xzf plumed-2.9.4.tgz
$ cd plumed-2.9.4/python/
$ make pypi
[...]
creating dist
Creating tar archive
removing 'plumed-2.9.4' (and everything under it)
echo "now use: python -m twine upload dist/plumed-2.9.4.tar.gz"
now use: python -m twine upload dist/plumed-2.9.4.tar.gz


which then creates pypi/dist/plumed-2.9.4.tar.gz which I can use for our own usage.

Getting some official plumed wrappers updated on PyPI would be appreciated though!

Cheers,
Oliver

Oliver Stueker

unread,
Sep 11, 2025, 2:52:21 PMSep 11
to plumed...@googlegroups.com
Hi Giovanni,

Yes, I can confirm that the plumed==2.9.4 release from PyPI works as expected.
I haven't been able to test the 2.10.0 yet, since I still have to build the corresponding version of PLUMED.

Yesterday I also discovered that I could just load modules for Python 3.13 and Cython (module load python/3.13 cython/3.1.2)
and then run "make pypi" from the "plumed-2.9.4/python" directory.

$ tar -xzf ~/.local/easybuild/sources/p/PLUMED/PLUMED-2.9.4.tgz
$ cd plumed-2.9.4/python
$ make pypi
$ cp pypi/dist/plumed-2.9.4.tar.gz ../../

Thank you!

Oliver

Oliver Stueker, Dr. rer. nat. (he/him)
Senior Digital Research Consultant, ACENET
A regional partner of the Digital Research Alliance of Canada


You received this message because you are subscribed to a topic in the Google Groups "PLUMED users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plumed-users/O8IGMtw_eSc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plumed-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/plumed-users/CAPLm8ZL%2B8h%2Bv3RVHm9sJh9tgu7PNCYHUCvUqUO%2BSDBRXcWPbaQ%40mail.gmail.com.

Giovanni Bussi

unread,
Sep 11, 2025, 2:53:51 PMSep 11
to plumed...@googlegroups.com
Good.

Please note that python wrappers and plumed libraries are cross compatible. You can use python wrappers from 2.10 to load plumed 2.9 or older (to some extent, perhaps if you go too old it could fail).

Giovanni


Reply all
Reply to author
Forward
0 new messages