]> git.ipfire.org Git - people/stevee/pakfire.git/blobdiff - macros/python.macro
macros: Drop anything related to Python 2
[people/stevee/pakfire.git] / macros / python.macro
index 15c1209eceded2ef65093fcc4ee643fae0514c6b..e703d85a41048b22b6aa832aea19c1af04bf4536 100644 (file)
@@ -1,18 +1,6 @@
-# A bunch of predefined things for Python.
-python_bytecompile_script = /usr/lib/pakfire/py-compile
-
-# Python 3 constants.
+# Python 3 constants
 python3 = /usr/bin/python3
-python3_bytecompile = %{python_bytecompile_script} --python=%{python3}
-
-python3_sitearch = %(%{python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
-python3_sitelib  = %(%{python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
-python3_version  = %(%{python3} -c "import sys; sys.stdout.write(sys.version[:3])")
-
-# Python 2 constants.
-python = /usr/bin/python2
-python_bytecompile = %{python_bytecompile_script} --python=%{python}
 
-python_sitearch = %(%{python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
-python_sitelib  = %(%{python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
-python_version  = %(%{python} -c "import sys; sys.stdout.write(sys.version[:3])")
+python3_sitearch = %(%{python3} -c "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': '%{prefix}', 'base': '%{prefix}'}))")
+python3_sitelib  = %(%{python3} -c "import sysconfig; print(sysconfig.get_path('purelib', vars={'platbase': '%{prefix}', 'base': '%{prefix}'}))")
+python3_version  = %(%{python3} -c "import sys; print('{0.major}.{0.minor}'.format(sys.version_info))")