meta.yaml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. {% set version = "3.9.17" %}
  2. {% set dev = "" %}
  3. {% set dev_ = "" %}
  4. {% set ver2 = '.'.join(version.split('.')[0:2]) %}
  5. {% set ver2nd = ''.join(version.split('.')[0:2]) %}
  6. {% set ver3nd = ''.join(version.split('.')[0:3]) %}
  7. {% set build_number = "0" %}
  8. {% set channel_targets = ('abc', 'def') %}
  9. # Sanitize build system env. var tweak parameters
  10. # (passed to the build scripts via script_env).
  11. {% set from_source_control = os.environ.get('CONDA_BUILD_FROM_SOURCE_CONTROL', '') %}
  12. {% if from_source_control == '' or from_source_control == 'no' %}
  13. {% set from_source_control = 'no' %}
  14. {% else %}
  15. {% set from_source_control = 'yes' %}
  16. {% endif %}
  17. {% set linkage_nature = os.environ.get('PY_INTERP_LINKAGE_NATURE', '') %}
  18. {% if linkage_nature != '' %}
  19. {% set linkage_nature = "_" ~ linkage_nature %}
  20. {% endif %}
  21. {% if linkage_nature == 'shared' %}
  22. {% set linkage_nature_env = 'shared' %}
  23. {% else %}
  24. {% set linkage_nature_env = 'static' %}
  25. {% endif %}
  26. {% set dbg_abi = '' %}
  27. {% set debug = os.environ.get('PY_INTERP_DEBUG', '') %}
  28. {% if debug != '' and debug != 'no' %}
  29. {% set py_interp_debug = "yes" %}
  30. {% set debug = "_dbg" %}
  31. {% set dbg_abi = "d" %} # [win]
  32. {% else %}
  33. {% set py_interp_debug = "no" %}
  34. {% endif %}
  35. package:
  36. name: python-split
  37. version: {{ version }}{{ dev }}
  38. source:
  39. {% if from_source_control == 'yes' %}
  40. - git_url: https://github.com/python/CPython.git
  41. git_tag: v{{ version }}{{ dev }}
  42. {% else %}
  43. - url: https://www.python.org/ftp/python/{{ version }}/Python-{{ version }}{{ dev }}.tar.xz
  44. sha256: 30ce057c44f283f8ed93606ccbdb8d51dd526bdc4c62cce5e0dc217bfa3e8cee
  45. {% endif %}
  46. patches:
  47. ## - patches/0000-Fix-off-by-one-error-in-_winapi_WaitForMultipleObjec.patch
  48. - patches/0001-Darwin-Add-arch-x86_64-to-UnicCCompiler-ld_args.patch
  49. - patches/0002-Win32-Change-FD_SETSIZE-from-512-to-2048.patch
  50. - patches/0003-Win32-distutils-Add-support-to-cygwinccompiler-for-V.patch
  51. - patches/0004-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch
  52. - patches/0005-Support-cross-compiling-byte-code.patch
  53. - patches/0006-Win32-Fixes-for-Windows-GCC-interop-needed-by-RPy2-a.patch
  54. - patches/0007-Darwin-Look-in-sysroot-usr-lib-include-if-sysroot-is.patch
  55. - patches/0008-runtime_library_dir_option-Use-1st-word-of-CC-as-com.patch
  56. - patches/0009-Win32-Do-not-download-externals.patch
  57. - patches/0010-Add-support-for-_CONDA_PYTHON_SYSCONFIGDATA_NAME-if-.patch
  58. - patches/0011-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch
  59. - patches/0012-Disable-new-dtags-in-unixccompiler.py.patch
  60. - patches/0013-Fix-cross-compilation-on-Debian-based-distros.patch
  61. - patches/0013-Add-CondaEcosystemModifyDllSearchPath.patch # [win]
  62. - patches/0014-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch
  63. - patches/0015-Unvendor-openssl.patch
  64. - patches/0016-Unvendor-sqlite3.patch
  65. - patches/0017-venv-Revert-a-change-from-https-github.com-python-cp.patch
  66. - patches/0018-Win-Add-back-the-DLLSuffix-used-to-find-the-openssl-.patch
  67. - patches/0019-Use-ranlib-from-env-if-env-variable-is-set.patch
  68. - patches/0020-Add-CondaEcosystemModifyDllSearchPath.patch # [not win]
  69. - patches/0021-Add-d1trimfile-SRC_DIR-to-make-pdbs-more-relocatable.patch
  70. - patches/0022-Doing-d1trimfile.patch
  71. # May be causing PGO to fail?
  72. - patches/0023-egg-debugging-with-Windows-debug-builds.patch
  73. # - patches/0024-Add-CONDA_DLL_SEARCH_MODIFICATION_KEEP_GIL-to-aid-de.patch
  74. - patches/0025-cross-compile-darwin.patch
  75. - patches/0032-Fix-TZPATH-on-windows.patch
  76. - patches/0033-gh24324.patch
  77. - patches/0034-have-pyunicode-decodeunicodeescape.patch
  78. # MailCap CVE (CVE-2015-20107) was fixed in 3.9.16
  79. # - patches/0035-py39-mailcap-CVE-2015-20107.patch
  80. {% if (openssl | string).startswith('3.0') %}
  81. - patches/0036-openssl3.patch
  82. {% endif %}
  83. {% if 'conda-forge' not in channel_targets %}
  84. - patches/9999-Add-Anaconda-Distribution-version-logic.patch # [not win]
  85. {% endif %}
  86. # TODO :: Depend on our own packages for these:
  87. - url: https://github.com/python/cpython-source-deps/archive/xz-5.2.5.zip # [win]
  88. folder: externals/xz-5.2.5 # [win]
  89. sha256: 6a4389cc05143beb2679b1299cecee71b02baa55e70f68a88b44dc01ad495424 # [win]
  90. # Not used as of 3.7b3 (tcltk from cpython-bin- is), but kept for archival and license reasons.
  91. - url: https://github.com/python/cpython-source-deps/archive/tcl-core-8.6.12.0.zip # [win]
  92. folder: externals/tcl-core-8.6.12.0 # [win]
  93. sha256: 0682e059dd2ec77b16384a98a65b93e5e719958863506b37235a3a26e9f47773 # [win]
  94. # Not used as of 3.7b3 (tcltk from cpython-bin- is), but kept for archival and license reasons.
  95. - url: https://github.com/python/cpython-source-deps/archive/tk-8.6.12.0.zip # [win]
  96. folder: externals/tk-8.6.12.0 # [win]
  97. sha256: 7d61434b941b395526b09f65273212df86681afc835b36494ca7c5bd9d8d3d50 # [win]
  98. - url: https://github.com/python/cpython-bin-deps/archive/tcltk-8.6.12.0.zip # [win]
  99. folder: externals/tcltk-8.6.12.0 # [win]
  100. sha256: 3a55e9e9fcb754b5a484a22d54841153f7624dd30f7b0c81b1cb05f38e2b5216 # [win]
  101. - url: https://github.com/python/cpython-source-deps/archive/tix-8.4.3.6.zip # [win]
  102. folder: externals/tix-8.4.3.6 # [win]
  103. sha256: e558e3dc5e67ac0942f8fceafce00ca46b177da9ebeaf38ec7fafd9b9913ac56 # [win]
  104. - url: https://github.com/python/cpython-source-deps/archive/bzip2-1.0.8.zip # [win]
  105. folder: externals/bzip2-1.0.8 # [win]
  106. sha256: 12c17d15f99e27235529574a722fb484a4e8fdf2427cef53b1b68bdf07e404a9 # [win]
  107. - url: https://github.com/python/cpython-source-deps/archive/zlib-1.2.12.zip # [win]
  108. folder: externals/zlib-1.2.12 # [win]
  109. sha256: 92197502951ac8414ece9f2d9fa2cc010c51d610e6b2ed9833ba4a35d65f222b # [win]
  110. - url: https://github.com/python/cpython-bin-deps/archive/nasm-2.11.06.zip # [win]
  111. folder: externals/nasm-2.11.06 # [win]
  112. sha256: de3c87b26a80e789986d8e6950c6304175d3829afe9c6c7211eb7257266ab0ac # [win]
  113. - url: https://github.com/python/cpython-bin-deps/archive/libffi-3.3.0.zip # [win]
  114. folder: externals/libffi-3.3.0 # [win]
  115. sha256: 69e3f7235108a75033cb9325a0a3535ba271d144ec66fccefe134eda27d7bcfe # [win]
  116. build:
  117. number: {{ build_number }}
  118. requirements:
  119. build:
  120. {% if from_source_control == 'yes' %}
  121. - git
  122. {% else %}
  123. - patch # [not win]
  124. - m2-patch # [win]
  125. - m2-gcc-libs # [win]
  126. {% endif %}
  127. host:
  128. outputs:
  129. - name: python
  130. script: build_base.sh # [unix]
  131. script: build_base.bat # [win]
  132. build:
  133. number: {{ build_number }}
  134. activate_in_script: true
  135. # Windows has issues updating python if conda is using files itself.
  136. # Copy rather than link.
  137. no_link:
  138. - DLLs/_ctypes.pyd # [win]
  139. ignore_run_exports: # [unix]
  140. # We delete the shared bzip2 library
  141. - bzip2 # [unix]
  142. # C++ only installed so CXX is defined for distutils/sysconfig.
  143. # It would be nice to split ignore_run_exports into two:
  144. # ignore_run_exports/from and ignore_run_exports/of, that way
  145. # we could just use ignore_run_exports/from: {{ compiler('cxx') }}
  146. # here instead of this nonsense:
  147. - clangxx_osx-64 # [osx]
  148. - clangxx_osx-aarch64 # [osxaarch64]
  149. - gxx_linux-64 # [linux64]
  150. - gxx_linux-aarch64 # [linux and aarch64]
  151. - gxx_linux-ppc64le # [linuxppc64le]
  152. - gxx_linux-s390x # [linuxs390x]
  153. - libstdcxx-ng # [linux and aarch64]
  154. # Disabled until verified to work correctly
  155. detect_binary_files_with_prefix: true
  156. # detect_binary_files_with_prefix: False
  157. # binary_has_prefix_files:
  158. # - lib/libpython{{ ver2 }}.*.1.0
  159. # - bin/python{{ ver2 }} # [linux]
  160. # - lib/libpython{{ ver2 }}.a # [linux]
  161. # - lib/libpython{{ ver2 }}.nolto.a # [linux]
  162. # - lib/libpython3.so # [linux]
  163. # - lib/python{{ ver2 }}/lib-dynload/_hashlib.cpython-{{ ver2nd }}-x86_64-linux-gnu.so # [linux]
  164. # - lib/libpython3.dylib # [osx]
  165. # match python.org compiler standard
  166. skip: true # [win and int(float(vc)) < 14]
  167. # skip_compile_pyc:
  168. # - '*.py' # [osx and arm64]
  169. {% if 'conda-forge' in channel_targets %}
  170. string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython
  171. {% else %}
  172. string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}
  173. {% endif %}
  174. {% if 'conda-forge' in channel_targets %}
  175. run_exports:
  176. noarch:
  177. - python
  178. weak:
  179. - python_abi {{ ver2 }}.* *_cp{{ ver2nd }}
  180. {% endif %}
  181. script_env:
  182. - PY_INTERP_LINKAGE_NATURE={{ linkage_nature_env }}
  183. - PY_INTERP_DEBUG={{ py_interp_debug }}
  184. # Putting these here means they get emitted to build_env_setup.{sh,bat} meaning we can launch IDEs
  185. # after sourcing or calling that script without examine the contents of conda_build.{sh,bat} for
  186. # important env. vars.
  187. - OPENSSL_DIR=%PREFIX%\Library # [win]
  188. - SQLITE3_DIR=%PREFIX%\Library # [win]
  189. {% if 'conda-forge' in channel_targets %}
  190. - CONDA_FORGE=yes
  191. {% else %}
  192. - CONDA_FORGE=no
  193. {% endif %}
  194. missing_dso_whitelist:
  195. - '**/MSVCR71.dll' # [win]
  196. - '**/MSVCR80.dll' # [win]
  197. # I have no idea why this is not in C:\Windows\System32\downlevel
  198. - '**/api-ms-win-core-path-l1-1-0.dll' # [win]
  199. # -=- libs that come from the sysroot.
  200. - '$RPATH/libc.so.6' # [linux64 or ppc64le]
  201. - '$RPATH/libcrypt.so.1' # [linux64 or ppc64le]
  202. - '$RPATH/libdl.so.2' # [linux64 or ppc64le]
  203. - '$RPATH/libm.so.6' # [linux64 or ppc64le]
  204. - '$RPATH/libnsl.so.1' # [linux64 or ppc64le]
  205. - '$RPATH/libpthread.so.0' # [linux64 or ppc64le]
  206. - '$RPATH/librt.so.1' # [linux64 or ppc64le]
  207. - '$RPATH/libutil.so.1' # [linux64 or ppc64le]
  208. requirements:
  209. build:
  210. - {{ compiler('c') }}
  211. - {{ compiler('cxx') }}
  212. - {{ ccache('native') }} # [unix]
  213. - ripgrep
  214. - sed # [unix]
  215. - {{ cdt('xorg-x11-proto-devel') }} # [linux]
  216. - {{ cdt('libx11-devel') }} # [linux]
  217. - {{ cdt('libuuid-devel') }} # [linux and not (ppc64le or aarch64)]
  218. - make # [not win]
  219. - libtool # [unix]
  220. - pkg-config # [not win]
  221. # configure script looks for llvm-ar for lto
  222. - llvm-tools # [osx]
  223. - ld_impl_{{ target_platform }} # [linux]
  224. {% if 'conda-forge' in channel_targets %}
  225. - binutils_impl_{{ target_platform }} # [linux]
  226. {% endif %}
  227. host:
  228. - bzip2 # [not win]
  229. - sqlite
  230. - xz # [not win]
  231. - unzip # [not win]
  232. - zlib # [not win]
  233. - openssl
  234. - readline # [not win]
  235. - tk # [not win]
  236. - ncurses # [unix]
  237. - libffi 3.4 # [not win]
  238. - ld_impl_{{ target_platform }} # [linux]
  239. run:
  240. - libffi >=3.4,<3.5 # [not win]
  241. - ld_impl_{{ target_platform }} # [linux]
  242. - tzdata
  243. {% if 'conda-forge' in channel_targets %}
  244. - ncurses # [unix]
  245. run_constrained:
  246. - python_abi {{ ver2 }}.* *_cp{{ ver2nd }}
  247. {% endif %}
  248. test:
  249. downstreams:
  250. - cython
  251. - setuptools
  252. requires:
  253. - ripgrep
  254. - cmake-no-system # [not (linux and ppc64le)] changed from cmake to support OpenSSL 3 bootstrap build
  255. - make # [unix]
  256. - ninja-base # changed from ninja to support OpenSSL 3 bootstrap build
  257. - {{ compiler('c') }}
  258. # Tried to use enable_language(C) to avoid needing this. It does not work.
  259. - {{ compiler('cxx') }}
  260. files:
  261. - tests/distutils/*
  262. - tests/cmake/*
  263. - tests/cython/*
  264. - tests/embedding-interpreter/*
  265. - tests/processpoolexecutor-max_workers-61/*
  266. - run_test.py
  267. commands:
  268. - echo on # [win]
  269. - set # [win]
  270. - python -V
  271. - python3 -V # [not win]
  272. - 2to3 -h
  273. - pydoc -h
  274. - python3-config --help # [not win]
  275. - python run_test.py
  276. - set "PIP_NO_BUILD_ISOLATION=False" # [win]
  277. - set "PIP_NO_DEPENDENCIES=True" # [win]
  278. - set "PIP_IGNORE_INSTALLED=True" # [win]
  279. - set "PIP_NO_INDEX=True" # [win]
  280. - set "PIP_CACHE_DIR=%CONDA_PREFIX%/pip_cache" # [win]
  281. - set "TEMP=%CONDA_PREFIX%/tmp" # [win]
  282. - mkdir "%TEMP%" # [win]
  283. - python -Im ensurepip --upgrade --default-pip # [win]
  284. # tzdata/zoneinfo test that will need the tzdata package to pass
  285. - python -c "from zoneinfo import ZoneInfo; from datetime import datetime; dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo('America/Los_Angeles')); print(dt.tzname())"
  286. - python -m venv test-venv
  287. - python -c "import sysconfig; print(sysconfig.get_config_var('CC'))" # [not win]
  288. # disabled due this test has issues with updated operating system version
  289. # - _CONDA_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_x86_64_conda_cos6_linux_gnu python -c "import sysconfig; print(sysconfig.get_config_var('CC'))" # [linux64]
  290. # check for unreplaced @ symbols in sysconfig files
  291. - for f in ${CONDA_PREFIX}/lib/python*/_sysconfig*.py; do echo "Checking $f:"; if [[ `rg @ $f` ]]; then echo "FAILED ON $f"; cat $f; exit 1; fi; done # [linux64 or osx]
  292. - test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.a # [unix]
  293. - test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.nolto.a # [unix]
  294. # https://github.com/conda-forge/python-feedstock/issues/384
  295. - if exist %PREFIX%\\Scripts\\pydoc exit 1 # [win]
  296. - if exist %PREFIX%\\Scripts\\idle exit 1 # [win]
  297. - if exist %PREFIX%\\Scripts\\2to3 exit 1 # [win]
  298. - if not exist %PREFIX%\\Scripts\\pydoc-script.py exit 1 # [win]
  299. - if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 # [win]
  300. - if not exist %PREFIX%\\Scripts\\2to3-script.py exit 1 # [win]
  301. - if not exist %PREFIX%\\Scripts\\idle.exe exit 1 # [win]
  302. - if not exist %PREFIX%\\Scripts\\2to3.exe exit 1 # [win]
  303. - if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 # [win]
  304. - pushd tests
  305. - pushd distutils
  306. - python setup.py install -v -v
  307. - python -c "import foobar"
  308. - popd
  309. - pushd embedding-interpreter # [unix]
  310. - bash build-and-test.sh # [unix and not (linux and aarch64)]
  311. - popd # [unix]
  312. - pushd cmake # [not (linux and ppc64le)]
  313. - run_cmake_test.bat {{ version }} # [win]
  314. - bash run_cmake_test.sh {{ version }} # [not win and not (linux and ppc64le)]
  315. - popd # [not (linux and ppc64le)]
  316. - pushd processpoolexecutor-max_workers-61
  317. - python ppe.py
  318. - popd
  319. - popd
  320. - test ! -f default.profraw # [osx]
  321. - python -c "import ssl; assert ' {{ openssl }}' in ssl.OPENSSL_VERSION"
  322. - name: python-regr-testsuite
  323. requirements:
  324. host:
  325. - {{ pin_subpackage('python', exact=True) }}
  326. script: install_regr_testsuite.sh # [unix]
  327. - name: libpython-static
  328. noarch: python # [unix]
  329. script: build_static.sh # [unix]
  330. script: build_static.bat # [win]
  331. skip: true # [win]
  332. build:
  333. number: {{ build_number }}
  334. activate_in_script: true
  335. ignore_run_exports:
  336. - python_abi
  337. {% if 'conda-forge' in channel_targets %}
  338. string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython
  339. {% else %}
  340. string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}
  341. {% endif %}
  342. requirements:
  343. build:
  344. - {{ compiler('c') }}
  345. - {{ compiler('cxx') }}
  346. {% if from_source_control == 'yes' %}
  347. - git
  348. {% endif %}
  349. - {{ ccache('native') }} # [unix]
  350. host:
  351. - {{ pin_subpackage('python', exact=True) }}
  352. run:
  353. - {{ pin_subpackage('python', exact=True) }}
  354. test:
  355. files:
  356. - tests/embedding-interpreter/*
  357. requires:
  358. - ripgrep
  359. - cmake # [not (linux and ppc64le)]
  360. - make # [unix]
  361. - {{ compiler('c') }}
  362. # Tried to use enable_language(C) to avoid needing this. It does not work.
  363. - {{ compiler('cxx') }}
  364. commands:
  365. - test -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.a # [unix]
  366. - test -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.nolto.a # [unix]
  367. - test -f ${PREFIX}/lib/python${PKG_VERSION%.*}/config-${PKG_VERSION%.*}-darwin/libpython${PKG_VERSION%.*}.a # [osx]
  368. - pushd tests # [unix]
  369. - pushd embedding-interpreter # [unix]
  370. - bash build-and-test.sh # [unix]
  371. - popd # [unix]
  372. - popd # [unix]
  373. about:
  374. home: https://www.python.org/
  375. license: PSF-2.0
  376. license_family: PSF
  377. license_file: LICENSE
  378. license_url: https://docs.python.org/3.9/license.html
  379. summary: General purpose programming language
  380. description: |
  381. Python is a widely used high-level, general-purpose, interpreted, dynamic
  382. programming language. Its design philosophy emphasizes code
  383. readability, and its syntax allows programmers to express concepts in
  384. fewer lines of code than would be possible in languages such as C++ or
  385. Java. The language provides constructs intended to enable clear programs
  386. on both a small and large scale.
  387. doc_url: https://www.python.org/doc/versions/
  388. dev_url: https://devguide.python.org/
  389. extra:
  390. feedstock-name: python
  391. recipe-maintainers:
  392. - isuruf
  393. - jakirkham
  394. - mbargull
  395. - mingwandroid
  396. - msarahan
  397. - pelson
  398. - ocefpaf
  399. - scopatz