Commit Graph

199 Commits

Author SHA1 Message Date
sthen 2be6a44549 only print MODPY_PYBUILD message if pyproject.toml exists for Python 3,
MODPY_PYBUILD isn't used for 2.7.
2024-12-26 11:03:27 +00:00
sthen fa99bbe6b1 carry out a few more checks on MODPY_PYBUILD settings, which identify some
common mistakes (in particular, missing changes to build system done with an
update).

not fatal because sometimes there may be a reason for it not matching up,
but it's not resulting in many false warnings.

defer printing this until fake-install where it's more likely to be seen
(otherwise it's likely to be hidden by a wall of scrolling messages with
some build systems).
2024-12-23 14:36:21 +00:00
sthen a9fb5e6ee0 minor tweaks, mostly to comments 2024-12-23 14:30:46 +00:00
sthen 999161335d update python/3 to 3.12.8 and do some other overhaul while there
(since any python branch switch touches thousands of ports):

- stop using FLAVOR=python3 / MODPY_FLAVOR / etc in py3 ports.

- rename MODPY_EGG_VERSION (which refers to an obsolete packaging
format) with MODPY_DISTV (easier to type and line up in Makefiles)

bumps and adjustments to follow. lots of help from tb@, thanks!
2024-12-21 11:32:44 +00:00
sthen 2ca9d0b331 support setuptools-rust for MODPY_PYBUILD 2024-12-20 12:10:02 +00:00
sthen 3b6e41722a retire MODPY_BIN_SUFFIX, there are no Python 2 ports using it, and it
has been set to <empty> on py3 ports since Feb 2021, since when there
has been enough churn that existing PLIST entries etc referencing it
are not trustworthy. no change to python-module(5) needed as it wasn't
documented there anyway.
2024-12-18 19:20:36 +00:00
kirill 0195869583 lang/python/python.port.mk: introduce MODPY_TEST_SO_CMD
When MODPY_TEST_LINK_SO is enabled, python.port.mk links all .so files
in ${WRKSRC} which is required when port using tests which use Python
code that loads .so files via relative imports.

tweeks, feedback and OK: kn@ sthen@
2024-10-28 19:44:21 +00:00
sthen f63a131566 fix logic error introduced while sorting in previous 2024-07-25 15:42:03 +00:00
sthen 83bf201f4b handle MODPY_PYBUILD=pdm 2024-07-25 15:35:38 +00:00
sthen 30b455efbd let MODPY_COMPILEALL work as far as it can for py2 2024-05-28 21:14:52 +00:00
sthen 90bf4dd7c0 Add MODPY_COMPILEALL with a standard invocation to run "compileall".
Compared to the various ad-hoc ones used in the ports tree, this sets
parallelism if MAKE_JOBS is set, strips ${WRKINST} from the pyc files
(i.e. the pobj directory), and uses standard optimization levels.

(I have diffs for the various ports using ad-hoc compileall.py that
I'll test)
2024-05-28 16:04:58 +00:00
sthen 74da50600f Allow setting MODPY_PYTEST_USERARGS as a user setting (e.g. in /etc/mk.conf)
adding to the standard pytest command line. Can be used for e.g. -v (to add
verbosity), --color=yes, adjust traceback print mode, etc. See "py.test -h".
2024-05-28 16:02:11 +00:00
sthen a645ab48e9 switch default py3 version to 3.11
looks reasonable to tb@
2024-05-06 12:20:20 +00:00
sthen aaf344ca94 rename MODPY_PYBUILD=bootstrap to MODPY_PYBUILD=other as there are some less
common backends (like pdm-backend) which don't seem particularly widely used
so it seems useful to have a generic mechanism for these.
2024-04-17 13:33:56 +00:00
sthen f7f9dcc87a add maturin as a build backend for MODPY_PYBUILD 2024-04-14 12:08:52 +00:00
sthen ad9c4806d2 add python to TEST_DEPENDS if MODPY_PYTEST is set to 'no'. 2024-03-18 14:33:13 +00:00
sthen bf893086f3 handle MODPY_PYBUILD=jupyter_packaging 2023-12-22 12:51:20 +00:00
sthen ee25a7fcf0 Don't accept "Yes" as a value of MODPY_PYBUILD; use "bootstrap" instead
for those special-case ports which bootstrap from their own internal
PEP517 build backend.
2023-12-20 13:29:33 +00:00
sthen 85dbbc61c4 allow settings args to MODPY_BUILD_TARGET for MODPY_PYBUILD
useful for e.g. adding --config-setting
2023-12-15 14:19:17 +00:00
sthen 68d5077ab5 handle MODPY_PYBUILD=flit_scm 2023-11-23 12:34:21 +00:00
sthen 9b03a9df17 SITES for MODPY_PI 2023-09-20 13:41:38 +00:00
sthen 9fdf3bd034 fix stupid editor linewrapping 2022-12-06 16:18:16 +00:00
sthen 0fa138d7d0 handle MODPY_PYBUILD=hatch-vcs 2022-12-06 16:17:25 +00:00
sthen bc85bbe650 list allowed values if an unknown MODPY_PYBUILD is used 2022-11-29 11:19:45 +00:00
sthen 57d2b90569 adjust warning text from the 'Try to detect the case where a port will
build regardless of setuptools' check to suggest MODPY_PYBUILD not just
MODPY_SETUPTOOLS
2022-11-28 21:16:55 +00:00
sthen d858b7cc2a Ports built with setuptools on python 3.10 don't need a RUN_DEPENDS on
setuptools (it's used as a package locator but importlib.metadata in
newer Python core or the external importlib_metadata are preferred).
So drop the RDEP in that case (it's still kept for py27) and bump
revisions.
2022-11-26 23:28:11 +00:00
sthen b7554f3b92 warn if MODPY_PYBUILD is used and not set to setuptools_scm when the
port appears to need setuptools_scm.
2022-11-25 16:33:15 +00:00
sthen f04e702653 use absolute paths in MODPY_TEST_LIBDIR, relative paths don't work if
MODPY_TEST_DIR is set
2022-11-25 16:32:04 +00:00
sthen 80fda491b1 switch MODPY_DEFAULT_VERSION_3 to 3.10 2022-11-13 15:26:02 +00:00
kmos 633af1ae20 Add Python 3.11.0 to build and python.port.mk
ok sthen@ tb@
2022-10-31 22:06:28 +00:00
sthen 3c1c57ea49 add notes about keeping REVISION/PKGNAME in -current/next release above the
version in -stable of the previous release when plist is changed etc
(e.g. backporting updates to -stable after swotching the default
Python version during a release cycle means that -current needs
to keep ahead of -stable, to avoid problems with -stable packages
at the next release)
2022-10-23 10:14:04 +00:00
sthen 2206a80000 rename MODPY_PEP517 to MODPY_PYBUILD which is a bit less of a
magic-numbers name and more of a nod at the frontend we're actually
using for the build.
2022-09-13 20:56:17 +00:00
sthen d1168dff6f add MODPY_PEP517=setuptools_scm to add the extra dep 2022-09-12 19:52:16 +00:00
sthen df75ef21c7 fix r1.164 differently, don't adjust MODPY_CMD which is actually used
in port Makefiles (I thought it was internal). fixes calibre
2022-08-29 15:43:20 +00:00
sthen 2628d6aa03 set "nojunk" for setuptools builds done via MODPY_PEP517 (already set
for those builds done via MODPY_SETUPTOOLS - I was hoping we'd get
away without it for pep517 setuptools builds but naddy ran into a
build problem with py-cryptography which seems that it can only have
happened if importlib-metadata was installed and junked at the wrong
time during build)

we _may_ need nojunk for the other pep517 backends but let's try to
avoid it if possible first.
2022-08-29 13:23:02 +00:00
sthen 0d61a66187 make sure MAKE_ENV is passed in for MODPY_PEP517 builds 2022-08-26 13:39:36 +00:00
sthen 20f0a9c7c7 setup default MODPY_TEST_LIBDIR to include the build dir used by pep517 ports 2022-08-22 14:42:38 +00:00
sthen 8fc67391ae PEP 517-based ports don't have "./setup.py test" (which was deprecated
anyway), so in the case of MODPY_PEP517, default to MODPY_PYTEST=Yes to
use py-test infrastructure.
2022-08-22 11:16:50 +00:00
sthen cbe17bf091 add src to PYTHONPATH for MODPY_PYTEST ports (as well as
the existing lib, src, and the constructed lib.openbsd-$OBSD_VER-arch-$PY_VER)
2022-08-18 19:32:47 +00:00
sthen e77e795dc1 handle MODPY_PEP517=poetry-core for automatically adding the bdep, ok kmos@ 2022-08-18 00:50:52 +00:00
sthen 35f910e621 use ${MODPY_BIN} -m build rather than pip to build wheels 2022-08-16 12:10:28 +00:00
sthen 08ce32504c don't trigger the MODPY_PEP517 printf unless there's a build-backend line
in the file for now
2022-08-15 23:06:29 +00:00
sthen 56a3e4da96 MODPY_PEP517=setuptools also needs py-wheel 2022-08-15 11:51:42 +00:00
sthen b146ee177c add setuptools as a MODPY_PEP517 backend.
change from substring match to equality checks so that e.g. listing multiple
backends for MODPY_PEP517 isn't allowed (AFAIK it won't be needed anyway,
it's possible to just set "yes" instead of a backend name and list the
deps in a port itself, plus it wasn't handled properly in the pile of
.elifs).
2022-08-15 10:58:15 +00:00
sthen cadb24e98d Print some text to show in the log when generating a minimal setup.py
for setuptools ports with no distributed setup.py file; this suggests that
they probably ought to use MODPY_PEP517 instead so it's helpful to have
this show up in build logs.
2022-08-15 10:55:56 +00:00
sthen 831f6c45e9 don't allow setting both MODPY_SETUPTOOLS and MODPY_PEP517 2022-08-14 13:22:57 +00:00
sthen 0260e06f81 allow MODPY_PEP517=Yes to avoid the fatal, it is needed in some
cases (e.g. when using build backend internal to the distribution)
2022-08-13 17:20:17 +00:00
sthen 58ebbb9cb3 add a Fatal for unknown MODPY_PEP517 values. 2022-08-13 17:18:16 +00:00
sthen b884d8b9ee s/hatch/hatchling/ for MODPY_PEP517 2022-08-13 17:16:37 +00:00
sthen 4c3986bdbb add build infrastructure for Python ports using PEP517, ok kmos 2022-08-13 17:10:46 +00:00