#967 Document the automatic %python_provide
Merged 4 years ago by churchyard. Opened 4 years ago by churchyard.
churchyard/packaging-committee auto_python_provide  into  master

@@ -20,7 +20,6 @@ 

  %package -n python3-%{srcname}

  Summary:        %{summary}

  BuildRequires:  python3-devel

- %{?python_provide:%python_provide python3-%{srcname}}

  

  %description -n python3-%{srcname} %_description

  

@@ -108,14 +108,30 @@ 

  

  === The %python_provide macro

  

- All packages that provide `+python3-%{srcname}+` (for any `+%{srcname}+`) SHOULD use the `+%python_provide+` macro with the package name, for example:

+ All packages that provide `+python3-...+` (for any `+...+`) SHOULD use the `+%python_provide+` macro with the provide, for example:

  

  ----

- %{?python_provide:%python_provide python3-%{srcname}}

+ Provides: python3-pkg_resources = %{version}-%{release}

+ %{?python_provide:%python_provide python3-pkg_resources}

  ----

  

- In Fedora 31 and further, it adds a virtual provide of `+python-%{srcname}+` for Python 3 libraries.

+ In Fedora 31 and further, it adds a virtual provide of `+python-...+` for Python 3 libraries.

  For previous releases, it used to add the virtual provide for Python 2 libraries.

+ Since Fedora 33, it also adds virtual provide of `+python3X-...+` (for example `+python39-...+`).

+ 

+ On Fedora 33 or newer it is no longer needed to use `+%python_provide+` for package names:

+ 

+ ----

+ %package -n python3-%{srcname}

+ Summary: %{summary}

+ %{?python_provide:%python_provide python3-%{srcname}}

+ ----

+ 

+ Such provides are now added automatically.

+ (The only exception are meta-packages without files, for technical limitations.)

+ Packagers SHOULD try to remove explicit `+%python_provide+` calls for package names,

+ but MAY preserve them if they aim for compatibility with older releases.

+ 

  

  == Automatic Provides with a standardized name

  
@@ -182,7 +198,7 @@ 

  

  |`+%{python_provide}+`

  |(Lua script)

- |Given a package name, evaluates to either `Provides: python-$name` or nothing at all depending on the Python version. See <<The %python_provide macro>> for an example.

+ |See <<The %python_provide macro>> for detailed explanation.

  

  |`+%{python3_sitelib}+`

  |`+/usr/lib/python3.X/site-packages+`
@@ -345,5 +361,5 @@ 

  * *Must*: Python modules must not download any dependencies during the build process.

  * *Must*: When building a compat package, it must install using easy_install -m so it won't conflict with the main package.

  * *Must*: When building multiple versions (for a compat package) one of the packages must contain a default version that is usable via "import MODULE" with no prior setup.

- * *Should*: If you build a Python module you should use the `+%python_provide+` macro.

+ * *Should*: Additional `+python3-...+` provides should be accompanied by a `+%python_provide+` call.

  * *Should*: A package which is used by another package via an egg interface should provide egg info.

@@ -59,7 +59,6 @@ 

  %package -n python2-%{srcname}

  Summary:        %{summary}

  BuildRequires:  python2-devel

- %{?python_provide:%python_provide python2-%{srcname}}

  

  %description -n python2-%{srcname} %_description

  
@@ -67,7 +66,6 @@ 

  %package -n python3-%{srcname}

  Summary:        %{summary}

  BuildRequires:  python3-devel

- %{?python_provide:%python_provide python3-%{srcname}}

  

  %description -n python3-%{srcname} %_description

  
@@ -217,7 +215,6 @@ 

  %package -n python2-%{srcname}

  Summary:        %{summary}

  BuildRequires:  python2-devel

- %{?python_provide:%python_provide python2-%{srcname}}

  

  %description -n python2-%{srcname} %_description

  %endif
@@ -226,7 +223,6 @@ 

  %package -n python3-%{srcname}

  Summary:        %{summary}

  BuildRequires:  python3-devel

- %{?python_provide:%python_provide python3-%{srcname}}

  

  %description -n python3-%{srcname} %_description

  

rebased onto e028e00c2f1fcd4e021049f6231166db80703f90

4 years ago

+1

Seems fine, although there are now no examples using the python_provides? Maybe worth having one?

There is:

Provides: python3-pkg_resources = %{version}-%{release}
%{?python_provide:%python_provide python3-pkg_resources}

rebased onto ed17b8e

4 years ago

Pull-Request has been merged by churchyard

4 years ago