From 976a523fb87ef25d5be2c4b782d9c0368ae9f49f Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Tue, 31 May 2022 11:48:12 +0200 Subject: Notes work. --- .gitignore | 21 ++++----- main.pdf | Bin 50895 -> 67346 bytes main.tex | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- package.png | Bin 103868 -> 0 bytes package.spec | 44 ------------------- 5 files changed, 131 insertions(+), 72 deletions(-) delete mode 100644 package.png delete mode 100644 package.spec diff --git a/.gitignore b/.gitignore index 1367c3f..ab93fb4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,11 @@ -main.aux -main.fdb_latexmk -main.fls -main.log -main.nav -main.out -main.snm -main.synctex.gz -main.toc -_minted-main/* +*.aux +*.fdb_latexmk +*.fls +*.log +*.nav +*.out +*.snm +*.synctex.gz +*.toc +*.vrb +_minted-*/* diff --git a/main.pdf b/main.pdf index a32009b..c814e40 100644 Binary files a/main.pdf and b/main.pdf differ diff --git a/main.tex b/main.tex index 2c806a8..8d6d374 100644 --- a/main.tex +++ b/main.tex @@ -1,15 +1,23 @@ -\documentclass[aspectratio=169,british]{beamer} +\documentclass[aspectratio=169]{beamer} +%\setbeameroption{show notes on second screen} +\usepackage[utf8]{inputenc} \usepackage{graphicx} -\usepackage{bookman} \usepackage{tikz} \usetikzlibrary{shapes.geometric} -\usetheme{opensuse} +\definecolor{SUSEgreen}{RGB}{115, 186, 37} +\usecolortheme[named=SUSEgreen]{structure} + +\usepackage{fontspec} +\setmainfont{Urania Czech} +\setsansfont{Urania Czech} + +\usepackage{minted} \title{Python packaging in openSUSE} \subtitle{Advantages against other distributions} -\author{Matěj Cepl} -\date{June 2022} +\author[mcepl]{Matěj Cepl \\ \texttt{mcepl@cepl.eu}} +\date[openSUSECon 2022]{openSUSE Conference, June 2022} \newcommand{\authortitle}{} \newcommand{\organization}{SUSE} \newcommand{\event}{OpenSUSE Conference 2022} @@ -41,22 +49,22 @@ \frametitle{Multiple interpreters} \begin{minipage}[t]{.35\textwidth} -\begin{verbatim} +\begin{minted}{spec} %build %if %{with python3} %py3_build %else %py2_build %endif -\end{verbatim} +\end{minted} \end{minipage} % \hfill % \pause % \begin{minipage}[t]{.35\textwidth} -\begin{verbatim} +\begin{minted}{spec} %build %python_build -\end{verbatim} +\end{minted} \end{minipage} \end{frame} @@ -64,36 +72,130 @@ \begin{frame}[fragile] \frametitle{Complicated commands} -\begin{verbatim} +\begin{minted}{spec} %check export PYTHONPATH=%{buildroot}%{python_sitelib} PYTHONDONTWRITEBYTECODE=1 pytest --ignore=build.* -v -\end{verbatim} +\end{minted} -And this is still not correct, because it must be done for all +\note{And this is still not correct, because it must be done for all Python versions separately (and those \texttt{--ignore=build*} -must be arranged accordingly). +must be arranged accordingly). And we need to be able to take + into consideration existing \texttt{PYTHONPATH}.} \pause -\begin{verbatim} + +Or we do: + +\begin{minted}{spec} %check %pytest -\end{verbatim} +\end{minted} \end{frame} -\begin{frame} - \frametitle{Thank you!} + +\begin{frame}[fragile] +\frametitle{Example} + +\scriptsize + +\begin{minted}{spec} +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-foobar +Version: 1.0.2 +Release: 0 +Summary: Example foobar package +License: MIT +URL: https://github.com/bumba/foobar +Source: https://files.pythonhosted.org/packages/source/f/foobar/foobar-%{version}.zip +# PATCH-FIX-UPSTREAM remove_mock.patch bsc#123456 mcepl@suse.com +# we don't need stinking mock +Patch0: remove_mock.patch +BuildRequires: %{python_module appdirs} +BuildRequires: %{python_module pytest} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-appdirs +BuildArch: noarch +%python_subpackages + +%description +foobar is a collection of enhancements to the Python packages that +allow you to build and distribute Python packages, +\end{minted} + +\note[item]{Eliminate as much boiler-plate as possible. We + have only two lines now, which are same every time: that + python\_module definition and Release. And in both cases we are + just forced to have them there by the mechanics of RPM.} +\note[item]{Note that macro python\_subpackages, that’s the + root of all machinations. In effect this SPEC file is just a + foundation, I don’t want to use the term “template”, because + that would be misleading, for multiple generated ones.} \end{frame} +\begin{frame}[fragile] +\frametitle{Example (cont.)} + +\scriptsize + +\begin{minted}{spec} +%prep +%autosetup -p1 -n foobar-%{version} + +%build +export NOBUMPA=1 +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%license LICENSE +%doc CHANGES.rst README.rst +%{_bindir}/foobar +%{python_sitelib}/foobar +%{python_sitelib}/foobar-%{version}*-info + +%changelog +\end{minted} + +\note[item]{Using \texttt{autosetup} to avoid dealing with each patch again.} + +\end{frame} + +\begin{frame} + \frametitle{Not enough checking} + + \begin{itemize} + \item Given the number of packages we maintain (over + 2,500 in Factory) we need to put as much work as possible + on machines. + \item Packages are auto-generated by `py2pack`. + \end{itemize} + +\note[item]{They are auto-generated, but they are more like a + ready-to-cook food, they need to be finished.} +\note[item]{And yes, it is similar to the Fedora’s + \texttt{pyp2rpm}, but we have never managed to unify two + code-bases. If anybody is willing to do the work, it would be + lovely.} + +\end{frame} \begin{frame} \frametitle{Thank you!} My email is mcepl@cepl.eu.\vspace{1em} - \tiny \LaTeX\hspace{0.01em} source of this presentation is availalbe on https://gitlab.com/mcepl/opensuseconf.git. + \tiny \LaTeX\hspace{0.01em} source of this presentation is + available on https://gitlab.com/mcepl/opensuseconf.git. \end{frame} diff --git a/package.png b/package.png deleted file mode 100644 index f9f9304..0000000 Binary files a/package.png and /dev/null differ diff --git a/package.spec b/package.spec deleted file mode 100644 index 2be6e7f..0000000 --- a/package.spec +++ /dev/null @@ -1,44 +0,0 @@ -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -Name: python-foobar -Version: 1.0.2 -Release: 0 -Summary: Example foobar package -License: MIT -URL: https://github.com/bumba/foobar -Source: https://files.pythonhosted.org/packages/source/s/foobar/foobar-%{version}.zip -# PATCH-FIX-UPSTREAM remove_mock.patch bsc#123456 mcepl@suse.com -# we don't need stinking mock -Patch0: remove_mock.patch -BuildRequires: %{python_module appdirs} -BuildRequires: %{python_module pytest} -BuildRequires: fdupes -BuildRequires: python-rpm-macros -Requires: python-appdirs -BuildArch: noarch -%python_subpackages - -%description -foobar is a collection of enhancements to the Python packages that -allow you to build and distribute Python packages, - -%prep -%autosetup -p1 -n foobar-%{version} - -%build -%python_build - -%install -%python_install -%python_expand %fdupes %{buildroot}%{$python_sitelib} - -%check -%pytest -k - -%files %{python_files} -%license LICENSE -%doc CHANGES.rst README.rst -%{_bindir}/foobar -%{python_sitelib}/foobar -%{python_sitelib}/foobar-%{version}-py%{python_version}.egg-info - -%changelog -- cgit