Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openSUSE teample: add package name to sitelib path #154

Merged
merged 1 commit into from
May 11, 2022

Conversation

sebix
Copy link
Contributor

@sebix sebix commented Jan 28, 2022

Submissions to devel:languages:python are not accepted if
%{python_sitelib}/*
is used, so add the name of the library to produce a default value which
is permitted in openSUSE.

Copy link
Contributor

@mcepl mcepl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think?

py2pack/templates/opensuse.spec Show resolved Hide resolved
test/examples/py2pack-opensuse-augmented.spec Show resolved Hide resolved
@sebix
Copy link
Contributor Author

sebix commented May 10, 2022

What do you think?

Makes sense, thanks for the proposal

@sebix
Copy link
Contributor Author

sebix commented May 10, 2022

the test fail does not seem related:
test_template[opensuse.spec-True]

E           #
E           # spec file for package python-py2pack
E           #
E           # Copyright (c) 2022 SUSE LLC
E           #
E           # All modifications and additions to the file contributed by third parties
E           # remain the property of their copyright owners, unless otherwise agreed
E           # upon. The license for this file, and modifications and additions to the
E           # file, is the same license as for the pristine package itself (unless the
E           # license for the pristine package is not an Open Source License, in which
E           # case the license is the MIT License). An "Open Source License" is a
E           # license that conforms to the Open Source Definition (Version 1.9)
E           # published by the Open Source Initiative.
E           
E           # Please submit bugfixes or comments via https://bugs.opensuse.org/
E           #
E           
E           
E           %{?!python_module:%define python_module() python-%{**} python3-%{**}}
E           Name:           python-py2pack
E           Version:        0.8.5
E           Release:        0
E           Summary:        Generate distribution packages from PyPI
E           License:        Apache-2.0
E           URL:            http://github.com/openSUSE/py2pack
E           Source:         https://files.pythonhosted.org/packages/source/p/py2pack/py2pack-%{version}.tar.gz
E           BuildRequires:  python-rpm-macros
E           BuildRequires:  %{python_module setuptools}
E         - BuildRequires:  %{python_module pbr >= 1.8}
E         - # SECTION test requirements
E         - BuildRequires:  %{python_module Jinja2}
E         - BuildRequires:  %{python_module metaextract}
E         - BuildRequires:  %{python_module setuptools}
E         - BuildRequires:  %{python_module six}
E         - BuildRequires:  %{python_module coverage}
E         - BuildRequires:  %{python_module ddt}
E         - BuildRequires:  %{python_module flake8}
E         - BuildRequires:  %{python_module pytest}
E         - BuildRequires:  %{python_module Sphinx >= 1.2.1}
E         - BuildRequires:  %{python_module sphinxcontrib.programoutput}
E         - # /SECTION
E           BuildRequires:  fdupes
E         - Requires:       python-Jinja2
E         - Requires:       python-metaextract
E         - Requires:       python-setuptools
E         - Requires:       python-six
E         - Suggests:       python-typing
E           BuildArch:      noarch
E           %python_subpackages
E           
E           %description
E         - Generate distribution packages from PyPI
E         + Py2pack: Generate distribution packages from PyPI
E         ? +++++++++
E         + =================================================
E         + 
E         + .. image:: https://travis-ci.org/openSUSE/py2pack.png?branch=master
E         +         :target: https://travis-ci.org/openSUSE/py2pack
E         + 
E         + 
E         + This script allows to generate RPM spec or DEB dsc files from Python modules.
E         + It allows to list Python modules or search for them on the Python Package Index
E         + (PyPI). Conveniently, it can fetch tarballs and changelogs making it an
E         + universal tool to package Python modules.
E         + 
E         + 
E         + Installation
E         + ------------
E         + 
E         + To install py2pack from the `Python Package Index`_, simply:
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ pip install py2pack
E         + 
E         + Or, if you absolutely must:
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ easy_install py2pack
E         + 
E         + But, you really shouldn't do that. Lastly, you can check your distro of choice
E         + if they provide packages. For openSUSE, you can find packages in the `Open
E         + Build Service`_ for all releases. If you happen to use openSUSE:Factory (the
E         + rolling release / development version), simply:
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ sudo zypper install python-py2pack
E         + 
E         + 
E         + Usage
E         + -----
E         + 
E         + Lets suppose you want to package zope.interface_ and you don't know how it is named
E         + exactly. First of all, you can search for it and download the source tarball if
E         + you found the correct module:
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ py2pack search zope.interface
E         +     searching for module zope.interface...
E         +     found zope.interface-3.6.1
E         +     $ py2pack fetch zope.interface
E         +     downloading package zope.interface-3.6.1...
E         +     from http://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.6.1.tar.gz
E         + 
E         + 
E         + As a next step you may want to generate a package recipe for your distribution.
E         + For RPM_-based distributions (let's use openSUSE_ as an example), you want to
E         + generate a spec file (named 'python-zope.interface.spec'):
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ py2pack generate zope.interface -t opensuse.spec -f python-zope.interface.spec
E         + 
E         + The source tarball and the package recipe is all you need to generate the RPM_
E         + (or DEB_) file.
E         + This final step may depend on which distribution you use. Again,
E         + for openSUSE_ (and by using the `Open Build Service`_), the complete recipe is:
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ osc mkpac python-zope.interface
E         +     $ cd python-zope.interface
E         +     $ py2pack fetch zope.interface
E         +     $ py2pack generate zope.interface -f python-zope.interface.spec
E         +     $ osc build
E         +     ...
E         + 
E         + Depending on the module, you may have to adapt the resulting spec file slightly.
E         + To get further help about py2pack usage, issue the following command:
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ py2pack help
E         + 
E         + 
E         + Hacking and contributing
E         + ------------------------
E         + 
E         + You can test py2pack from your git checkout by executing the py2pack module:
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ python -m py2pack
E         + 
E         + Fork `the repository`_ on Github to start making your changes to the **master**
E         + branch (or branch off of it). Don't forget to write a test for fixed issues or
E         + implemented features whenever appropriate. You can invoke the testsuite from
E         + the repository root directory via `tox`_:
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ tox
E         + 
E         + To run a single test class via `tox`_, use i.e.:
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ tox -epy27 test.test_py2pack:Py2packTestCase
E         + 
E         + 
E         + You can also run `pytest`_ directly:
E         + 
E         + .. code-block:: bash
E         + 
E         +     $ pytest
E         + 
E         + It assumes you have the test dependencies installed (available on PYTHONPATH)
E         + on your system.
E         + 
E         + :copyright: (c) 2013 Sascha Peilicke.
E         + :license: Apache-2.0, see LICENSE for more details.
E         + 
E         + 
E         + .. _argparse: http://pypi.python.org/pypi/argparse
E         + .. _Jinja2: http://pypi.python.org/pypi/Jinja2
E         + .. _zope.interface: http://pypi.python.org/pypi/zope.interface/
E         + .. _openSUSE: http://www.opensuse.org/en/
E         + .. _RPM: http://en.wikipedia.org/wiki/RPM_Package_Manager
E         + .. _DEB: http://en.wikipedia.org/wiki/Deb_(file_format)
E         + .. _`Python Package Index`: https://pypi.org/
E         + .. _`Open Build Service`: https://build.opensuse.org/package/show/devel:languages:python/python-py2pack
E         + .. _`the repository`: https://github.com/openSUSE/py2pack
E         + .. _`pytest`: https://github.com/pytest-dev/pytest
E         + .. _`tox`: http://testrun.org/tox
E           
E           %prep
E           %setup -q -n py2pack-%{version}
E           
E           %build
E           %python_build
E           
E           %install
E           %python_install
E         - %python_clone -a %{buildroot}%{_bindir}/py2pack
E           %python_expand %fdupes %{buildroot}%{$python_sitelib}
E           
E         - %check
E         - CHOOSE: %pytest OR %pyunittest -v OR CUSTOM
E         - 
E         - %post
E         - %python_install_alternative py2pack
E         - 
E         - %postun
E         - %python_uninstall_alternative py2pack
E         - 
E           %files %{python_files}
E         - %doc AUTHORS ChangeLog README.rst
E         - %license LICENSE
E         - %python_alternative %{_bindir}/py2pack
E           %{python_sitelib}/py2pack
E           %{python_sitelib}/py2pack-%{version}*-info

@mcepl
Copy link
Contributor

mcepl commented May 11, 2022

@sebix Could you please rebase here? Let’s see whether my other PR really helped.

Submissions to devel:languages:python are not accepted if
%{python_sitelib}/*
is used, so add the name of the library to produce a default value which
is permitted in openSUSE.
@sebix
Copy link
Contributor Author

sebix commented May 11, 2022

Looks good - finally :)

@mcepl
Copy link
Contributor

mcepl commented May 11, 2022

Thank you!

@mcepl mcepl merged commit 5475d47 into openSUSE:master May 11, 2022
@sebix sebix deleted the opensuse-sitelib-path branch October 11, 2022 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants