Open slavaGanzin opened 2 months ago
I had to comment out Pandas
and PyYAML
in requirements.in
as those versions are referring to very old releases that are no longer available with Python 3.12. Also seriate
doesn't install as there's no recent release for ortool
available for Python 3.12. Same goes for scipy
, where a recent version would be 1.13, not 1.2 …
Please update your dependencies to make this project usable with Python 3.12.
I was able to get a bit further with this fork: https://github.com/ryzhakar/hercules
However, the Python dependencies still wouldn't build. I wrote a requirements.in
that looks like this:
fastdtw==0.3.4
hdbscan==0.8.38.post1
lifelines==0.29.0
matplotlib==3.9.2
munch==4.0.0
numpy==1.26.4
ortools==7.8.7959
pandas==2.2.3
protobuf==5.28.2
python_dateutil==2.9.0.post0
PyYAML==6.0.2
scipy==1.14.1
seriate==1.1.2
setuptools==75.1.0
tensorflow==2.17.0
tqdm==4.66.5
But it couldn't find a matching ortools
version.
ortools
is unavailable for python 3.12. Thus seriate
will never have its dependencies satisfied.
Also, the code in e.g. models/burndown.py
uses DataFrame.append
which was removed in pandas>=2.0
, thus even with recent dependencies installed, this code won't properly work without refactoring.
I was able to run labours -m burndown-project
using the following install instructions:
https://github.com/gwenzek/hercules?tab=readme-ov-file#installation
I've tried to put the most up to date versions of each dep that would work with the current code.
Only tested with burndown-project
so far which was my main interest.
Updating further is non trivial, cause it also requires updating some of the dependencies.
I was able to run labours -m burndown-project using the following install instructions
That gets me a lot further!
Now I get:
File "/Users/chucker/hercules/venv/bin/labours", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/chucker/hercules/python/labours/cli.py", line 154, in main
reader = read_input(args)
^^^^^^^^^^^^^^^^
File "/Users/chucker/hercules/python/labours/readers.py", line 439, in read_input
reader.read(ins)
File "/Users/chucker/hercules/python/labours/readers.py", line 220, in read
from labours.pb_pb2 import AnalysisResults
File "/Users/chucker/hercules/python/labours/pb_pb2.py", line 35, in <module>
_descriptor.FieldDescriptor(
File "/Users/chucker/hercules/venv/lib/python3.12/site-packages/google/protobuf/descriptor.py", line 621, in __new__
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
If I set that environment variable, it proceeds, then eventually says:
Traceback (most recent call last):
File "/Users/chucker/hercules/venv/bin/labours", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/chucker/hercules/python/labours/cli.py", line 154, in main
reader = read_input(args)
^^^^^^^^^^^^^^^^
File "/Users/chucker/hercules/python/labours/readers.py", line 439, in read_input
reader.read(ins)
File "/Users/chucker/hercules/python/labours/readers.py", line 233, in read
for key, val in self.data.contents.items():
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RepeatedCompositeFieldContainer' object has no attribute 'items'
Does this suggest I need to recreate the generated code? (How?)
I think the protobuffer integration is broken in my branch, but you don't have to use protobuffer to save Hercules analysis
Ah yes. It does work if I don't specify ProtoBuf. For example:
./hercules --burndown --first-parent some/path/to/local/repo | labours -m burndown-project
Thanks!
python -V Python 3.12.5
pip 24.2 (python 3.12)
pip install labours Collecting labours Using cached labours-10.7.2-py3-none-any.whl.metadata (24 kB) Collecting matplotlib<4.0,>=2.0 (from labours) Using cached matplotlib-3.9.2-cp312-cp312-macosx_10_12_x86_64.whl.metadata (11 kB) Collecting numpy<2.0,>=1.12.0 (from labours) Using cached numpy-1.26.4-cp312-cp312-macosx_10_9_x86_64.whl.metadata (61 kB) Collecting pandas<1.0,>=0.20.0 (from labours) Using cached pandas-0.25.3.tar.gz (12.6 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [31 lines of output]