Drop support for Python 3.7.
Python 3.7 reaches end-of-life on 27 June 2023 (https://devguide.python.org/versions/), and future versions of MuJoCo (after 2.3.6) will no longer support it. PiperOrigin-RevId: 543594006 Change-Id: I66a7db3dab5d08f2fc52912c43e1532080600fc8
This commit is contained in:
committed by
Copybara-Service
parent
a7021df63e
commit
551a7bbc38
@@ -69,7 +69,7 @@ Users who wish to build MuJoCo from source should consult the [build from
|
||||
source] section of the documentation. However, please note that the commit at
|
||||
the tip of the `main` branch may be unstable.
|
||||
|
||||
### Python (>= 3.7)
|
||||
### Python (>= 3.8)
|
||||
|
||||
The native Python bindings, which come pre-packaged with a copy of MuJoCo, can
|
||||
be installed from [PyPI] via:
|
||||
|
||||
@@ -1,51 +1,41 @@
|
||||
auditwheel==5.3.0 \
|
||||
--hash=sha256:1da1af54de5badd10149250c257a799be003fd976794716f17914e3d4b4a9fc9
|
||||
numpy==1.21.6; python_version < '3.8' \
|
||||
--hash=sha256:bcb238c9c96c00d3085b264e5c1a1207672577b93fa666c3b14a45240b14123a \
|
||||
--hash=sha256:7c4068a8c44014b2d55f3c3f574c376b2494ca9cc73d2f1bd692382b6dffe3db \
|
||||
--hash=sha256:a6be4cb0ef3b8c9250c19cc122267263093eee7edd4e3fa75395dfda8c17a8e2 \
|
||||
--hash=sha256:6aaf96c7f8cebc220cdfc03f1d5a31952f027dda050e5a703a0d1c396075e3e7
|
||||
numpy==1.24.2; python_version >= '3.8' \
|
||||
--hash=sha256:557d42778a6869c2162deb40ad82612645e21d79e11c1dc62c6e82a2220ffb04 \
|
||||
--hash=sha256:9a23f8440561a633204a67fb44617ce2a299beecf3295f0d13c495518908e910 \
|
||||
--hash=sha256:4cecaed30dc14123020f77b03601559fff3e6cd0c048f8b5289f4eeabb0eb281 \
|
||||
--hash=sha256:4173bde9fa2a005c2c6e2ea8ac1618e2ed2c1c6ec8a7657237854d42094123a0 \
|
||||
--hash=sha256:7de8fdde0003f4294655aa5d5f0a89c26b9f22c0a58790c38fae1ed392d44a5a \
|
||||
--hash=sha256:97cf27e51fa078078c649a51d7ade3c92d9e709ba2bfb97493007103c741f1d0 \
|
||||
--hash=sha256:a51725a815a6188c662fb66fb32077709a9ca38053f0274640293a14fdd22978 \
|
||||
--hash=sha256:6524630f71631be2dabe0c541e7675db82651eb998496bbe16bc4f77f0772253 \
|
||||
--hash=sha256:e8d2859428712785e8a8b7d2b3ef0a1d1565892367b32f915c4a4df44d0e64f5 \
|
||||
--hash=sha256:eef70b4fc1e872ebddc38cddacc87c19a3709c0e3e5d20bf3954c147b1dd941d \
|
||||
--hash=sha256:a77d3e1163a7770164404607b7ba3967fb49b24782a6ef85d9b5f54126cc39e5 \
|
||||
--hash=sha256:f64bb98ac59b3ea3bf74b02f13836eb2e24e48e0ab0145bbda646295769bd780 \
|
||||
--hash=sha256:889b2cc88b837d86eda1b17008ebeb679d82875022200c6e8e4ce6cf549b7acb \
|
||||
--hash=sha256:adbdce121896fd3a17a77ab0b0b5eedf05a9834a18699db6829a64e1dfccca7f \
|
||||
--hash=sha256:4199e7cfc307a778f72d293372736223e39ec9ac096ff0a2e64853b866a8e18a \
|
||||
--hash=sha256:76807b4063f0002c8532cfeac47a3068a69561e9c8715efdad3c642eb27c0756 \
|
||||
--hash=sha256:2eabd64ddb96a1239791da78fa5f4e1693ae2dadc82a76bc76a14cbb2b966e96 \
|
||||
--hash=sha256:c29e6bd0ec49a44d7690ecb623a8eac5ab8a923bce0bea6293953992edf3a76a \
|
||||
--hash=sha256:c72a6b2f4af1adfe193f7beb91ddf708ff867a3f977ef2ec53c0ffb8283ab9f5 \
|
||||
--hash=sha256:d0a2db9d20117bf523dde15858398e7c0858aadca7c0f088ac0d6edd360e9ad2
|
||||
pip==23.1.0 \
|
||||
--hash=sha256:64b1d4528e491aa835ec6ece0c1ac40ce6ab6d886e60740f6519db44b2e9634d
|
||||
PyOpenGL==3.1.6 \
|
||||
--hash=sha256:a7139bc3e15d656feae1f7e3ef68c799941ed43fadc78177a23db7e946c20738
|
||||
pytest==7.3.1 \
|
||||
--hash=sha256:3799fa815351fea3a5e96ac7e503a96fa51cc9942c3753cda7651b93c1cfa362
|
||||
setuptools==67.7.0 \
|
||||
--hash=sha256:888be97fde8cc3afd60f7784e678fa29ee13c4e5362daa7104a93bba33646c50
|
||||
auditwheel==5.4.0 \
|
||||
--hash=sha256:d8410a17523427ba3f7b60c9701d23de28b8f94fa5dab732aa6c30d160df8127
|
||||
numpy==1.24.3; python_version == '3.8' \
|
||||
--hash=sha256:56e48aec79ae238f6e4395886b5eaed058abb7231fb3361ddd7bfdf4eed54289 \
|
||||
--hash=sha256:4749e053a29364d3452c034827102ee100986903263e89884922ef01a0a6fd2f \
|
||||
--hash=sha256:ecde0f8adef7dfdec993fd54b0f78183051b6580f606111a6d789cd14c61ea0c \
|
||||
--hash=sha256:ae8d0be48d1b6ed82588934aaaa179875e7dc4f3d84da18d7eae6eb3f06c242c \
|
||||
--hash=sha256:7776ea65423ca6a15255ba1872d82d207bd1e09f6d0894ee4a64678dd2204078
|
||||
numpy==1.25.0; python_version >= '3.9' \
|
||||
--hash=sha256:b76aa836a952059d70a2788a2d98cb2a533ccd46222558b6970348939e55fc24 \
|
||||
--hash=sha256:e559c6afbca484072a98a51b6fa466aae785cfe89b69e8b856c3191bc8872a82 \
|
||||
--hash=sha256:ecc68f11404930e9c7ecfc937aa423e1e50158317bf67ca91736a9864eae0232 \
|
||||
--hash=sha256:9c7211d7920b97aeca7b3773a6783492b5b93baba39e7c36054f6e749fc7490c \
|
||||
--hash=sha256:4c69fe5f05eea336b7a740e114dec995e2f927003c30702d896892403df6dbf0 \
|
||||
--hash=sha256:c0dc071017bc00abb7d7201bac06fa80333c6314477b3d10b52b58fa6a6e38f6 \
|
||||
--hash=sha256:4aedd08f15d3045a4e9c648f1e04daca2ab1044256959f1f95aafeeb3d794c16 \
|
||||
--hash=sha256:d6b267f349a99d3908b56645eebf340cb58f01bd1e773b4eea1a905b3f0e4208 \
|
||||
--hash=sha256:9e3f2b96e3b63c978bc29daaa3700c028fe3f049ea3031b58aa33fe2a5809d24 \
|
||||
--hash=sha256:8aa130c3042052d656751df5e81f6d61edff3e289b5994edcf77f54118a8d9f4 \
|
||||
--hash=sha256:26815c6c8498dc49d81faa76d61078c4f9f0859ce7817919021b9eba72b425e3 \
|
||||
--hash=sha256:5177310ac2e63d6603f659fadc1e7bab33dd5a8db4e0596df34214eeab0fee3b \
|
||||
--hash=sha256:5aa48bebfb41f93043a796128854b84407d4df730d3fb6e5dc36402f5cd594c0 \
|
||||
--hash=sha256:7cd981ccc0afe49b9883f14761bb57c964df71124dcd155b0cba2b591f0d64b9 \
|
||||
--hash=sha256:b792164e539d99d93e4e5e09ae10f8cbe5466de7d759fc155e075237e0c274e4 \
|
||||
pip==23.1.2 \
|
||||
--hash=sha256:3ef6ac33239e4027d9a5598a381b9d30880a1477e50039db2eac6e8a8f6d1b18
|
||||
PyOpenGL==3.1.7 \
|
||||
--hash=sha256:a6ab19cf290df6101aaf7470843a9c46207789855746399d0af92521a0a92b7a
|
||||
pytest==7.3.2 \
|
||||
--hash=sha256:cdcbd012c9312258922f8cd3f1b62a6580fdced17db6014896053d47cddf9295
|
||||
setuptools==68.0.0 \
|
||||
--hash=sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f
|
||||
wheel==0.40.0 \
|
||||
--hash=sha256:d236b20e7cb522daf2390fa84c55eea81c5c30190f90f29ae2ca1ad8355bf247
|
||||
|
||||
# Transitive dependencies of auditwheel
|
||||
importlib-metadata==6.5.0; python_version < '3.8' \
|
||||
--hash=sha256:03ba783c3a2c69d751b109fc0c94a62c51f581b3d6acf8ed1331b6d5729321ff
|
||||
pyelftools==0.29 \
|
||||
--hash=sha256:519f38cf412f073b2d7393aa4682b0190fa901f7c3fa0bff2b82d537690c7fc1
|
||||
typing-extensions==4.5.0; python_version < '3.8' \
|
||||
--hash=sha256:fb33085c39dd998ac16d1431ebc293a8b3eedd00fd4a32de0ff79002c19511b4
|
||||
zipp==3.15.0; python_version < '3.8' \
|
||||
--hash=sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556
|
||||
|
||||
# Transitive dependencies of pytest
|
||||
attrs==23.1.0 \
|
||||
@@ -60,7 +50,7 @@ packaging==23.1 \
|
||||
--hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61
|
||||
pluggy==1.0.0 \
|
||||
--hash=sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3
|
||||
pyparsing==3.0.9 \
|
||||
--hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc
|
||||
pyparsing==3.1.0 \
|
||||
--hash=sha256:d554a96d1a7d3ddaf7183104485bc19fd80543ad6ac5bdb6426719d766fb06c1
|
||||
tomli==2.0.1; python_version < '3.11' \
|
||||
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
absl-py==1.4.0 \
|
||||
--hash=sha256:0d3fe606adfa4f7db64792dd4c7aee4ee0c38ab75dfd353b7a83ed3e957fcb47
|
||||
pip==23.1.0 \
|
||||
--hash=sha256:64b1d4528e491aa835ec6ece0c1ac40ce6ab6d886e60740f6519db44b2e9634d
|
||||
setuptools==67.7.0 \
|
||||
--hash=sha256:888be97fde8cc3afd60f7784e678fa29ee13c4e5362daa7104a93bba33646c50
|
||||
pip==23.1.2 \
|
||||
--hash=sha256:3ef6ac33239e4027d9a5598a381b9d30880a1477e50039db2eac6e8a8f6d1b18
|
||||
setuptools==68.0.0 \
|
||||
--hash=sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f
|
||||
|
||||
@@ -42,7 +42,6 @@ __attribute__((used)) void mjpython_show_dock_icon() {
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
// TODO(b/273744079): Remove Python 3.7 code after end-of-life (27 Jun 2023).
|
||||
namespace {
|
||||
// 16MiB is the default Python thread stack size on macOS as of Python 3.11
|
||||
// https://bugs.python.org/issue18075
|
||||
@@ -51,29 +50,16 @@ constexpr rlim_t kThreadStackSize = 0x1000000;
|
||||
struct {
|
||||
#define CPYTHON_FN(fname) decltype(&::fname) fname
|
||||
|
||||
#if PY_MINOR_VERSION >= 8
|
||||
// go/keep-sorted start
|
||||
CPYTHON_FN(PyConfig_Clear);
|
||||
CPYTHON_FN(PyConfig_InitPythonConfig);
|
||||
CPYTHON_FN(PyConfig_SetBytesArgv);
|
||||
CPYTHON_FN(Py_InitializeFromConfig);
|
||||
CPYTHON_FN(Py_RunMain);
|
||||
// go/keep-sorted end
|
||||
#else
|
||||
// go/keep-sorted start
|
||||
CPYTHON_FN(PyMem_RawFree);
|
||||
CPYTHON_FN(Py_DecodeLocale);
|
||||
CPYTHON_FN(Py_Initialize);
|
||||
CPYTHON_FN(Py_Main);
|
||||
CPYTHON_FN(Py_SetProgramName);
|
||||
// go/keep-sorted end
|
||||
#endif
|
||||
|
||||
// go/keep-sorted start
|
||||
CPYTHON_FN(PyGILState_Ensure);
|
||||
CPYTHON_FN(PyGILState_Release);
|
||||
CPYTHON_FN(PyRun_SimpleStringFlags);
|
||||
CPYTHON_FN(Py_FinalizeEx);
|
||||
CPYTHON_FN(Py_InitializeFromConfig);
|
||||
CPYTHON_FN(Py_RunMain);
|
||||
// go/keep-sorted end
|
||||
|
||||
#undef CPYTHON_FN
|
||||
@@ -92,21 +78,11 @@ void* mjpython_pymain(void* vargs) {
|
||||
PyGILState_STATE gil;
|
||||
|
||||
// Initialize the Python interpreter.
|
||||
#if PY_MINOR_VERSION >= 8
|
||||
PyConfig config;
|
||||
cpython.PyConfig_InitPythonConfig(&config);
|
||||
cpython.PyConfig_SetBytesArgv(&config, args->argc, args->argv);
|
||||
cpython.Py_InitializeFromConfig(&config);
|
||||
cpython.PyConfig_Clear(&config);
|
||||
#else
|
||||
// Convert each argv to wchar_t* (needed for Py_Main).
|
||||
wchar_t** wargv = static_cast<wchar_t**>(std::calloc(args->argc, sizeof(wchar_t*)));
|
||||
for (int i = 0; i < args->argc; ++i) {
|
||||
wargv[i] = cpython.Py_DecodeLocale(args->argv[i], nullptr);
|
||||
}
|
||||
cpython.Py_SetProgramName(wargv[0]);
|
||||
cpython.Py_Initialize();
|
||||
#endif
|
||||
|
||||
// Set up the condition variable to pass control back to the macOS main thread.
|
||||
gil = cpython.PyGILState_Ensure();
|
||||
@@ -187,22 +163,10 @@ del cond # Don't pollute globals for user script.
|
||||
)", nullptr);
|
||||
|
||||
// Run the Python interpreter main loop.
|
||||
#if PY_MINOR_VERSION >= 8
|
||||
cpython.Py_RunMain();
|
||||
#else
|
||||
cpython.Py_Main(args->argc, wargv);
|
||||
#endif
|
||||
|
||||
// Tear down the interpreter.
|
||||
cpython.Py_FinalizeEx();
|
||||
#if PY_MINOR_VERSION < 8
|
||||
for (int i = 0; i < args->argc; ++i) {
|
||||
cpython.PyMem_RawFree(wargv[i]);
|
||||
wargv[i] = nullptr;
|
||||
}
|
||||
std::free(wargv);
|
||||
wargv = nullptr;
|
||||
#endif
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace
|
||||
@@ -260,29 +224,16 @@ int main(int argc, char** argv) {
|
||||
} \
|
||||
}
|
||||
|
||||
#if PY_MINOR_VERSION >= 8
|
||||
// go/keep-sorted start
|
||||
CPYTHON_INITFN(PyConfig_Clear);
|
||||
CPYTHON_INITFN(PyConfig_InitPythonConfig);
|
||||
CPYTHON_INITFN(PyConfig_SetBytesArgv);
|
||||
CPYTHON_INITFN(Py_InitializeFromConfig);
|
||||
CPYTHON_INITFN(Py_RunMain);
|
||||
// go/keep-sorted end
|
||||
#else
|
||||
// go/keep-sorted start
|
||||
CPYTHON_INITFN(PyMem_RawFree);
|
||||
CPYTHON_INITFN(Py_DecodeLocale);
|
||||
CPYTHON_INITFN(Py_Initialize);
|
||||
CPYTHON_INITFN(Py_Main);
|
||||
CPYTHON_INITFN(Py_SetProgramName);
|
||||
// go/keep-sorted end
|
||||
#endif
|
||||
|
||||
// go/keep-sorted start
|
||||
CPYTHON_INITFN(PyGILState_Ensure);
|
||||
CPYTHON_INITFN(PyGILState_Release);
|
||||
CPYTHON_INITFN(PyRun_SimpleStringFlags);
|
||||
CPYTHON_INITFN(Py_FinalizeEx);
|
||||
CPYTHON_INITFN(Py_InitializeFromConfig);
|
||||
CPYTHON_INITFN(Py_RunMain);
|
||||
// go/keep-sorted end
|
||||
|
||||
#undef CPYTHON_INITFN
|
||||
|
||||
+1
-2
@@ -363,7 +363,6 @@ SETUP_KWARGS = dict(
|
||||
'License :: OSI Approved :: Apache Software License',
|
||||
'Natural Language :: English',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
@@ -385,7 +384,7 @@ SETUP_KWARGS = dict(
|
||||
CMakeExtension('mujoco._simulate'),
|
||||
CMakeExtension('mujoco._structs'),
|
||||
],
|
||||
python_requires='>=3.7',
|
||||
python_requires='>=3.8',
|
||||
install_requires=[
|
||||
'absl-py',
|
||||
'glfw',
|
||||
|
||||
Reference in New Issue
Block a user