ligo-segments issueshttps://git.ligo.org/lscsoft/ligo-segments/-/issues2023-10-02T10:02:18Zhttps://git.ligo.org/lscsoft/ligo-segments/-/issues/20Build fails with Python 3.12 and clang 15 on macOS2023-10-02T10:02:18ZDuncan Macleodduncan.macleod@ligo.orgBuild fails with Python 3.12 and clang 15 on macOSThe build of `ligo-segments` fails when using Python 3.12.0rc3 and clang 15.0.7:
```console
$ sw_vers
ProductName: macOS
ProductVersion: 11.7.9
BuildVersion: 20G1426
$ git describe
v1.0.0-126-gcd4d83f
$ python3 --version
Python 3.1...The build of `ligo-segments` fails when using Python 3.12.0rc3 and clang 15.0.7:
```console
$ sw_vers
ProductName: macOS
ProductVersion: 11.7.9
BuildVersion: 20G1426
$ git describe
v1.0.0-126-gcd4d83f
$ python3 --version
Python 3.12.0rc3
$ clang --version
clang version 15.0.7
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Users/duncanmacleod/opt/mambaforge/envs/py312/bin
$ python3 setup.py build
/Users/duncanmacleod/opt/mambaforge/envs/py312/lib/python3.12/site-packages/setuptools/dist.py:700: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
!!
********************************************************************************
Please replace its usage with implicit namespaces (PEP 420).
See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
********************************************************************************
!!
ep.load()(self, ep.name, value)
src/infinity.c:271:2: warning: suggest braces around initialization of subobject [-Wmissing-braces]
PyObject_HEAD_INIT(NULL)
^~~~~~~~~~~~~~~~~~~~~~~~
/Users/duncanmacleod/opt/mambaforge/envs/py312/include/python3.12/object.h:141:11: note: expanded from macro 'PyObject_HEAD_INIT'
{ 1 }, \
^
src/infinity.c:271:2: error: incompatible pointer to integer conversion initializing 'Py_ssize_t' (aka 'long') with an expression of type 'void *' [-Wint-conversion]
PyObject_HEAD_INIT(NULL)
^~~~~~~~~~~~~~~~~~~~~~~~
/Users/duncanmacleod/opt/mambaforge/envs/py312/include/python3.12/object.h:142:9: note: expanded from macro 'PyObject_HEAD_INIT'
(type) \
^~~~~~
1 warning and 1 error generated.
error: command '/Users/duncanmacleod/opt/mambaforge/envs/py312/bin/x86_64-apple-darwin13.4.0-clang' failed with exit code 1
```https://git.ligo.org/lscsoft/ligo-segments/-/issues/19ligo.segments.utils.from_bitstream raises RuntimeError2023-11-23T15:54:18ZDuncan Macleodduncan.macleod@ligo.orgligo.segments.utils.from_bitstream raises RuntimeErrorThe `ligo.segments.utils.from_bitstream` function raises a `RuntimeError` when executing the documented example on Python >=3.7:
```console
$ /usr/bin/python3 --version
Python 3.9.2
$ /usr/bin/python3 -c "import ligo.segments.utils; lis...The `ligo.segments.utils.from_bitstream` function raises a `RuntimeError` when executing the documented example on Python >=3.7:
```console
$ /usr/bin/python3 --version
Python 3.9.2
$ /usr/bin/python3 -c "import ligo.segments.utils; list(ligo.segments.utils.from_bitstream((True, True, False, True, False), 0, 1))"
Traceback (most recent call last):
File "/home/duncan/git/ligo-segments/ligo/segments/utils.py", line 377, in from_bitstream
if next(bitstream):
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
RuntimeError: generator raised StopIteration
```
On Python 3.6.8 (e.g. `/usr/bin/python3` on `ldas-pcdev1.ligo.caltech.edu` as of today) this is only a `DeprecationWarning`:
```console
$ /usr/bin/python3 --version
Python 3.6.8
$ /usr/bin/python3 -c "import ligo.segments.utils; list(ligo.segments.utils.from_bitstream((True, True, False, True, False), 0, 1))"
-c:1: DeprecationWarning: generator 'from_bitstream' raised StopIteration
```
The breaking change was introduced by [PEP-479](https://peps.python.org/pep-0479/) and released first in Python 3.7 as documented in the second bullet of https://docs.python.org/3/whatsnew/3.7.html#changes-in-python-behavior.https://git.ligo.org/lscsoft/ligo-segments/-/issues/18Please update CI (Python, Debian versions)2022-10-10T08:40:17ZSteffen GrunewaldPlease update CI (Python, Debian versions)Currently, the CI tests Python 2.7 and 3.4 (with failures), also there are build tests for Debian Jessie and Stretch but none for Buster nor Bullseye.
Please remove outdated Python and Debian versions, and add recent ones.Currently, the CI tests Python 2.7 and 3.4 (with failures), also there are build tests for Debian Jessie and Stretch but none for Buster nor Bullseye.
Please remove outdated Python and Debian versions, and add recent ones.https://git.ligo.org/lscsoft/ligo-segments/-/issues/17Can't compile with MSVC (and therefore install with pip) due to reusing of bu...2022-08-25T15:59:34ZArtem BasalaevCan't compile with MSVC (and therefore install with pip) due to reusing of built-in min/max function nameDear experts,
We rely on `ligo-segments` as a dependency of `GWpy`, which itself is a dependency for [our package](https://pypi.org/project/spicypy/). We use that outside of LIGO computing environment which complicates things somewhat. ...Dear experts,
We rely on `ligo-segments` as a dependency of `GWpy`, which itself is a dependency for [our package](https://pypi.org/project/spicypy/). We use that outside of LIGO computing environment which complicates things somewhat. Specifically, we found that one can't do `pip install ligo-segments` on windows in anaconda environment where MSVC is the default compiler (typical case), which leads to users being unable to install our package with `pip` as well[^1].
The issue itself is with following lines:
https://git.ligo.org/lscsoft/ligo-segments/-/blob/master/src/segmentlist.c#L199, https://git.ligo.org/lscsoft/ligo-segments/-/blob/master/src/segmentlist.c#L218
For which compiler says:
```
src/segmentlist.c(199): error C2059: syntax error: '<parameter-list>'
src/segmentlist.c(218): error C2059: syntax error: '<parameter-list>'
```
The message is a bit cryptic, but I think the problem is with function names on these lines, `min` and `max` - these keywords have a special meaning, or at least MSVC assumes so here. I was able to rectify the issue locally renaming them to `minimum` and `maximum` and correspondingly changing the calls on lines https://git.ligo.org/lscsoft/ligo-segments/-/blob/master/src/segmentlist.c#L343 and https://git.ligo.org/lscsoft/ligo-segments/-/blob/master/src/segmentlist.c#L350. I did not do thorough testing, but if this is the only place where these functions are used then the change should be rather straightforward and not affect any other usage/environments? In that case I'm happy to implement the fix myself and submit a merge request.
[^1]: Yes, `GWpy` can be installed with `conda` (and will contain already compiled binaries of `ligo-segments`), but not our package, and there are more problems for us when it comes to development dependencies which we manage with `poetry` - it only supports `pip`. Long story short would be great to be able to do everything with `pip`, especially if the fix is as easy as described here.https://git.ligo.org/lscsoft/ligo-segments/-/issues/16Is this project GPL-3.0-only or GPL-3.0-or-later2022-04-21T07:50:44ZDuncan Macleodduncan.macleod@ligo.orgIs this project GPL-3.0-only or GPL-3.0-or-laterThe license declaration for this project is `GPLv3`, does this mean [`GPL-3.0-only`](https://spdx.org/licenses/GPL-3.0-only.html) or [`GPL-3.0-or-later`](https://spdx.org/licenses/GPL-3.0-or-later.html)?The license declaration for this project is `GPLv3`, does this mean [`GPL-3.0-only`](https://spdx.org/licenses/GPL-3.0-only.html) or [`GPL-3.0-or-later`](https://spdx.org/licenses/GPL-3.0-or-later.html)?https://git.ligo.org/lscsoft/ligo-segments/-/issues/14distutils is deprecated as of Python 3.102021-11-08T10:09:08ZDuncan Macleodduncan.macleod@ligo.orgdistutils is deprecated as of Python 3.10The `distutils` module is deprecated as of Python 3.10 and will be removed in Python 3.12. This project should proabably switch to `setuptools` as a drop-in replacement. For full details, see <https://docs.python.org/3/whatsnew/3.10.html...The `distutils` module is deprecated as of Python 3.10 and will be removed in Python 3.12. This project should proabably switch to `setuptools` as a drop-in replacement. For full details, see <https://docs.python.org/3/whatsnew/3.10.html#distutils-deprecated>.https://git.ligo.org/lscsoft/ligo-segments/-/issues/13Restructure utils.py to avoid importing lal at the module level2022-05-16T06:56:35ZDuncan Macleodduncan.macleod@ligo.orgRestructure utils.py to avoid importing lal at the module levelWould it be possible to restructure `ligo/segments/utils.py` to avoid importing `lal` at the module level? The segments codes are immensely useful and an extra dependency on `python-lal` means that Windows usage is no longer possible. I ...Would it be possible to restructure `ligo/segments/utils.py` to avoid importing `lal` at the module level? The segments codes are immensely useful and an extra dependency on `python-lal` means that Windows usage is no longer possible. I am happy to do the work, in one of the following ways
- move the import of `lal.utils.CacheEntry` into the function that uses it, and then redefine `fromtama()` to only import `lal.LIGOTimeGPS` if `coltype` is not given by the user
- move the new 'Extra Manipulation Routines' to a new module that can be imported by `ligo/segments/__init__.py` without reservation
It would be great to avoid python-lal as a first-class requirement of ligo-segments (especially since ligo-segments is a first-class requirement of python-lal, which causes problems for building and testing on new platforms and/or python versions).https://git.ligo.org/lscsoft/ligo-segments/-/issues/11Incorrect permissions in ligo-segments-1.2.0.tar.gz tarball2020-08-10T14:39:27ZLeo P. SingerIncorrect permissions in ligo-segments-1.2.0.tar.gz tarballThe permissions in the ligo-segments-1.2.0.tar.gz tarball in software.ligo.org or PyPI are too restrictive and it is causing packaging and distributions issues (e.g., with MacPorts). The permissions for most files are 0600, but should be...The permissions in the ligo-segments-1.2.0.tar.gz tarball in software.ligo.org or PyPI are too restrictive and it is causing packaging and distributions issues (e.g., with MacPorts). The permissions for most files are 0600, but should be 0644.
I'm not sure what might cause this; it might be a bug in an old version of setuptools, or it might be an environment issue such as umask. Doing a new source release should fix this.
## Permissions for ligo-segments-1.2.0.tar.gz
```
$ curl https://software.igwn.org/lscsoft/source/ligo-segments-1.2.0.tar.gz | tar x
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 48871 100 48871 0 0 155k 0 --:--:-- --:--:-- --:--:-- 155k
$ ls -l ligo-segments-1.2.0/
total 128
-rw------- 1 lpsinger wheel 35147 Jun 4 2018 LICENSE
-rw------- 1 lpsinger wheel 173 Oct 17 2018 MANIFEST.in
-rw------- 1 lpsinger wheel 1063 Jan 15 2019 PKG-INFO
-rw------- 1 lpsinger wheel 135 Jun 4 2018 README.rst
drwx------ 8 lpsinger wheel 256 Jan 15 2019 debian
drwx------ 4 lpsinger wheel 128 Jan 15 2019 ligo
-rw------- 1 lpsinger wheel 2195 Jan 15 2019 ligo-segments.spec
-rw------- 1 lpsinger wheel 2199 Nov 2 2018 ligo-segments.spec.in
drwx------ 8 lpsinger wheel 256 Jan 15 2019 ligo_segments.egg-info
-rw------- 1 lpsinger wheel 38 Jan 15 2019 setup.cfg
-rw------- 1 lpsinger wheel 2957 Jan 9 2019 setup.py
drwx------ 7 lpsinger wheel 224 Jan 15 2019 src
drwx------ 7 lpsinger wheel 224 Jan 15 2019 test
```
## Permissions in a typical Python source package
```
$ curl https://software.igwn.org/lscsoft/source/ligo-gracedb-2.6.1.tar.gz | tar x
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2495k 100 2495k 0 0 1262k 0 0:00:01 0:00:01 --:--:-- 1261k
$ ls -l ligo-gracedb-2.6.1/
total 152
-rw-r--r-- 1 lpsinger staff 35149 Oct 1 2019 LICENSE
-rw-r--r-- 1 lpsinger staff 107 Oct 1 2019 MANIFEST.in
-rw-r--r-- 1 lpsinger staff 2235 Jun 5 13:33 PKG-INFO
-rw-r--r-- 1 lpsinger staff 872 Oct 1 2019 README.rst
drwxr-xr-x 8 lpsinger staff 256 Jun 5 13:33 debian
drwxr-xr-x 5 lpsinger staff 160 Jun 5 13:33 docs
drwxr-xr-x 4 lpsinger staff 128 Jun 5 13:33 ligo
-rw-r--r-- 1 lpsinger staff 3099 Jun 5 13:02 ligo-gracedb.spec
drwxr-xr-x 9 lpsinger staff 288 Jun 5 13:33 ligo_gracedb.egg-info
-rw-r--r-- 1 lpsinger staff 56 Oct 1 2019 requirements-dev.txt
-rw-r--r-- 1 lpsinger staff 24 Oct 1 2019 requirements-doc.txt
-rw-r--r-- 1 lpsinger staff 624 Jun 5 13:33 setup.cfg
-rw-r--r-- 1 lpsinger staff 4191 Jun 5 13:02 setup.py
-rw-r--r-- 1 lpsinger staff 273 Jun 3 17:14 tox.ini
```