From b9472a388980eaedcc9f060b99abc3365e7f4421 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Wed, 3 May 2023 22:02:36 +0200 Subject: [PATCH] Roll back all the editable install behaviour - it is not necessary just yet. --- .azure/scripts/coverage.yml | 2 +- .azure/scripts/debug.yml | 2 +- .azure/scripts/tracing.yml | 2 +- doc/CHANGELOG.rst | 7 ++++++- doc/develguide.rst | 4 ++-- pyproject.toml | 2 +- setup.py | 5 ++--- setupext/__init__.py | 1 - setupext/editable_wheel.py | 42 ------------------------------------- 9 files changed, 14 insertions(+), 53 deletions(-) delete mode 100644 setupext/editable_wheel.py diff --git a/.azure/scripts/coverage.yml b/.azure/scripts/coverage.yml index 2c676e3b5..77c8ae1d8 100644 --- a/.azure/scripts/coverage.yml +++ b/.azure/scripts/coverage.yml @@ -15,7 +15,7 @@ steps: displayName: 'Install requirements' - script: | - pip install -e .[tests] --install-option="--enable-coverage" --install-option="--enable-build-jar" + python setup.py develop --enable-coverage --enable-build-jar displayName: 'Build' - script: | diff --git a/.azure/scripts/debug.yml b/.azure/scripts/debug.yml index ebbdba021..4f8d9ca08 100644 --- a/.azure/scripts/debug.yml +++ b/.azure/scripts/debug.yml @@ -7,7 +7,7 @@ steps: - script: | sudo apt install gdb - pip install ./ # --install-option="--enable-tracing" + pip install ./ displayName: 'Build module' - script: python -c "import jpype" diff --git a/.azure/scripts/tracing.yml b/.azure/scripts/tracing.yml index d278ca1db..9f6fc0c3d 100644 --- a/.azure/scripts/tracing.yml +++ b/.azure/scripts/tracing.yml @@ -4,6 +4,6 @@ steps: inputs: versionSpec: '3.8' - script: | - pip install -e . --install-option="--enable-coverage" --install-option="--enable-build-jar" + python setup.py develop --enable-tracing --enable-build-jar displayName: 'Build' diff --git a/doc/CHANGELOG.rst b/doc/CHANGELOG.rst index 1815bc107..74451c308 100644 --- a/doc/CHANGELOG.rst +++ b/doc/CHANGELOG.rst @@ -9,10 +9,15 @@ Latest Changes: - Use PEP-518 and PEP-660 configuration for the package, allowing editable and configurable builds using modern Python packaging tooling. Where before ``python setup.py --enable-tracing develop``, now can be done with - ``pip install --editable ./ --install-option="--enable-tracing"``. + ``pip install --editable ./ --config-setting="--install-option=--enable-tracing"``. The old setup.py usage remains, but is discouraged, and the arguments are now passed after the command (previously they were specified before). + - Use PEP-518 configuration for the package, allowing + configurable builds using more up-to-date Python packaging tooling. + For editable installs, ``python setup.py --enable-tracing develop`` + must now be done with ``python setup.py develop --enable-tracing``. + - **1.5.0 - 2023-04-03** - Support for Python 3.12 diff --git a/doc/develguide.rst b/doc/develguide.rst index 01aec6de6..7ee92e934 100644 --- a/doc/develguide.rst +++ b/doc/develguide.rst @@ -943,7 +943,7 @@ must be enabled with a compiler switch to activate. To active the logger, touch one of the cpp files in the native directory to mark the build as dirty, then compile the ``jpype`` module with: :: - pip install -e . --install-option="--enable-tracing" + python setup.py develop --enable-tracing Once built run a short test program that demonstrates the problem and capture the output of the terminal to a file. This should allow the developer to isolate @@ -964,7 +964,7 @@ Coverage Some of the tests require additional instrumentation to run, this can be enabled with the ``enable-coverage`` option:: - pip install -e . --install-option="--enable-coverage" + python setup.py develop --enable-coverage Debugging issues diff --git a/pyproject.toml b/pyproject.toml index ef1947fc6..f35392751 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=65.*", # For editable_wheel command. + "setuptools", ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index c8fcec027..06f8c2064 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,8 @@ setup( - # Non-standard, and extension behaviour. See also: + # Non-standard, and extension behaviour of setup() - project information + # should be put in pyproject.toml wherever possible. See also: # https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#setuptools-specific-configuration platforms=[ 'Operating System :: Microsoft :: Windows', @@ -67,8 +68,6 @@ cmdclass={ 'build_ext': setupext.build_ext.BuildExtCommand, 'develop': setupext.develop.Develop, - # The command for pip --editable. - 'editable_wheel': setupext.editable_wheel.EditableWheel, 'test_java': setupext.test_java.TestJavaCommand, 'sdist': setupext.sdist.BuildSourceDistribution, 'test': setupext.pytester.PyTest, diff --git a/setupext/__init__.py b/setupext/__init__.py index ae12537f4..d4f70098f 100644 --- a/setupext/__init__.py +++ b/setupext/__init__.py @@ -19,7 +19,6 @@ from . import platform from . import build_ext from . import develop -from . import editable_wheel from . import test_java from . import sdist from . import pytester diff --git a/setupext/editable_wheel.py b/setupext/editable_wheel.py deleted file mode 100644 index a3329fbe4..000000000 --- a/setupext/editable_wheel.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -# ***************************************************************************** -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# See NOTICE file for details. -# -# ***************************************************************************** - -from setuptools.command.editable_wheel import editable_wheel as editable_wheel_cmd - - -class EditableWheel(editable_wheel_cmd): - user_options = editable_wheel_cmd.user_options + [ - ('enable-build-jar', None, 'Build the java jar portion'), - ('enable-tracing', None, 'Set for tracing for debugging'), - ('enable-coverage', None, 'Instrument c++ code for code coverage measuring'), - ] - - def initialize_options(self, *args): - self.enable_tracing = False - self.enable_build_jar = False - self.enable_coverage = False - super().initialize_options() - - def reinitialize_command(self, command, reinit_subcommands=0, **kw): - cmd = super().reinitialize_command(command, reinit_subcommands=reinit_subcommands, **kw) - build_ext_command = self.distribution.get_command_obj("build_ext") - build_ext_command.enable_tracing = self.enable_tracing - build_ext_command.enable_build_jar = self.enable_build_jar - build_ext_command.enable_coverage = self.enable_coverage - return cmd