Spaces:
Sleeping
Sleeping
Huiran Yu commited on
Commit ·
a52103d
1
Parent(s): 033f1b6
madmom py310 patch
Browse files- Dockerfile +27 -0
Dockerfile
CHANGED
|
@@ -21,6 +21,33 @@ RUN pip install --no-cache-dir setuptools==80.9.0
|
|
| 21 |
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 22 |
RUN pip install --no-cache-dir --no-build-isolation madmom
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
RUN python -c "import setuptools, pkg_resources; print('setuptools OK')"
|
| 25 |
|
| 26 |
# Copy the rest of the repo
|
|
|
|
| 21 |
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 22 |
RUN pip install --no-cache-dir --no-build-isolation madmom
|
| 23 |
|
| 24 |
+
# madmom patch
|
| 25 |
+
RUN python - <<'PY'
|
| 26 |
+
import site, pathlib
|
| 27 |
+
|
| 28 |
+
# find the installed madmom processors.py
|
| 29 |
+
paths = site.getsitepackages()
|
| 30 |
+
target = None
|
| 31 |
+
for p in paths:
|
| 32 |
+
cand = pathlib.Path(p) / "madmom" / "processors.py"
|
| 33 |
+
if cand.exists():
|
| 34 |
+
target = cand
|
| 35 |
+
break
|
| 36 |
+
|
| 37 |
+
if target is None:
|
| 38 |
+
raise SystemExit("madmom/processors.py not found")
|
| 39 |
+
|
| 40 |
+
txt = target.read_text(encoding="utf-8")
|
| 41 |
+
txt2 = txt.replace("from collections import MutableSequence",
|
| 42 |
+
"from collections.abc import MutableSequence")
|
| 43 |
+
if txt == txt2:
|
| 44 |
+
print("No change needed (pattern not found).")
|
| 45 |
+
else:
|
| 46 |
+
target.write_text(txt2, encoding="utf-8")
|
| 47 |
+
print("Patched:", target)
|
| 48 |
+
PY
|
| 49 |
+
|
| 50 |
+
|
| 51 |
RUN python -c "import setuptools, pkg_resources; print('setuptools OK')"
|
| 52 |
|
| 53 |
# Copy the rest of the repo
|