From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Tanguy Le Carrour <tanguy@bioneland.org>
Cc: 45931@debbugs.gnu.org
Subject: [bug#45931] [PATCH] gnu: Add python-build.
Date: Mon, 25 Jan 2021 09:27:32 -0500 [thread overview]
Message-ID: <87bldd3xd7.fsf@gmail.com> (raw)
In-Reply-To: <20210117101119.17861-1-tanguy@bioneland.org> (Tanguy Le Carrour's message of "Sun, 17 Jan 2021 11:11:19 +0100")
Hello Tanguy,
Tanguy Le Carrour <tanguy@bioneland.org> writes:
> * gnu/packages/python-xyz.scm (python-build): New variable.
> * gnu/packages/patches/python-build-disable-failing-tests.patch: Add patch.
> * gnu/local.mk: Add above patch.
> ---
> gnu/local.mk | 1 +
> .../python-build-disable-failing-tests.patch | 25 +++++++++++
> gnu/packages/python-xyz.scm | 42 +++++++++++++++++++
> 3 files changed, 68 insertions(+)
> create mode 100644 gnu/packages/patches/python-build-disable-failing-tests.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 77f1d4a096..f0702160c3 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -1526,6 +1526,7 @@ dist_patch_DATA = \
> %D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \
> %D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
> %D%/packages/patches/python-axolotl-AES-fix.patch \
> + %D%/packages/patches/python-build-disable-failing-tests.patch \
> %D%/packages/patches/python-cross-compile.patch \
> %D%/packages/patches/python2-larch-coverage-4.0a6-compatibility.patch \
> %D%/packages/patches/python-configobj-setuptools.patch \
> diff --git a/gnu/packages/patches/python-build-disable-failing-tests.patch b/gnu/packages/patches/python-build-disable-failing-tests.patch
> new file mode 100644
> index 0000000000..499dad2179
> --- /dev/null
> +++ b/gnu/packages/patches/python-build-disable-failing-tests.patch
> @@ -0,0 +1,25 @@
> +Disable failing tests.
> +
> +diff --git a/tests/test_env.py b/tests/test_env.py
> +index 5f9a710..c941a6c 100644
> +--- a/tests/test_env.py
> ++++ b/tests/test_env.py
> +@@ -13,6 +13,7 @@ import build.env
> +
> +
> + @pytest.mark.isolated
> ++@pytest.mark.skipif(True, reason="This fails for unknown reasons on Guix")
> + def test_isolation():
> + subprocess.check_call([sys.executable, '-c', 'import build.env'])
> + with build.env.IsolatedEnvBuilder() as env:
> +@@ -47,6 +48,7 @@ def test_isolated_environment_install(mocker):
> +
> +
> + @pytest.mark.isolated
> ++@pytest.mark.skipif(True, reason="This fails for unknown reasons on Guix")
> + def test_create_isolated_build_host_with_no_pip(tmp_path, capfd, mocker):
> + mocker.patch.object(build.env, 'pip', None)
> + expected = {'pip', 'greenlet', 'readline', 'cffi'} if platform.python_implementation() == 'PyPy' else {'pip'}
> +--
> +2.30.0
> +
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index d08e23936c..9a58ba50a2 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -3677,6 +3677,48 @@ text styles of documentation.")
> software version simply.")
> (license license:expat)))
>
> +(define-public python-build
> + (package
> + (name "python-build")
> + (version "0.1.0")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/pypa/build")
> + (commit version)))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> + "0mpciw66y130b704m3zrq4r473jw41b6p3sd1ya9my4v872r2dsw"))
> + (patches (search-patches "python-build-disable-failing-tests.patch"))))
> + (build-system python-build-system)
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (replace 'check
> + (lambda _
> + (setenv "PYTHONPATH"
> + (string-append
> + (getcwd) "/src/"
> + ":" (getenv "PYTHONPATH")))
> + (invoke "python" "-m" "pytest" "tests/"))))))
> + (propagated-inputs
> + `(("python-packaging" ,python-packaging)
> + ("python-pep517" ,python-pep517)
> + ("python-toml" ,python-toml)))
> + (native-inputs
> + `(("python-filelock" ,python-filelock)
> + ("python-pytest" ,python-pytest)
> + ("python-pytest-mock" ,python-pytest-mock)))
> + (home-page "https://github.com/pypa/build")
> + (synopsis "Simple and correct PEP517 package builder")
> + (description
> + "Build will invoke the PEP 517 hooks to build a distribution package.
> +It is a simple build tool and does not perform any dependency management.")
> + ;; MIT license
> + (license license:expat)))
> +
> (define-public python-deprecated
> (package
> (name "python-deprecated")
> --
> 2.30.0
This package was added to the core-updates branch on Jan 15 by myself; I
needed it to bump python-isort to a newer version after moving to Python
3.9.1.
I've named it 'python-pypa-build' and put it under a new module, (gnu
packages python-build). This module is special in that it's probably
going to get pulled by (guix build python-build-system) at some point,
so should be considered a 'build' module and not pull external modules
if possible.
If you need it on master we could try cherry picking a few commits from
core-updates, I think.
Thank you!
Maxim
next prev parent reply other threads:[~2021-01-25 14:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-17 10:11 [bug#45931] [PATCH] gnu: Add python-build Tanguy Le Carrour
2021-01-25 14:27 ` Maxim Cournoyer [this message]
2021-01-25 16:10 ` Tanguy LE CARROUR
2021-01-25 18:53 ` bug#45931: " Maxim Cournoyer
2021-01-26 7:28 ` [bug#45931] " Tanguy LE CARROUR
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bldd3xd7.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=45931@debbugs.gnu.org \
--cc=tanguy@bioneland.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).