diff --git a/.github/workflows/release_bump.yml b/.github/workflows/release_bump.yml index d07016f..f36f728 100644 --- a/.github/workflows/release_bump.yml +++ b/.github/workflows/release_bump.yml @@ -63,6 +63,7 @@ jobs: # Run semantic-release to generate new changelog pip install --upgrade hatch hatch env create release + hatch run release:deps NEXT_SEMVER=$(hatch run release:bump $BUMP_ARGS) # Grab the new version's changelog and prepend it to the original changelog contents diff --git a/hatch.toml b/hatch.toml index 3aba4f8..f78b2de 100644 --- a/hatch.toml +++ b/hatch.toml @@ -34,10 +34,8 @@ PIP_INDEX_URL="" [envs.release] detached = true -dependencies = [ - "python-semantic-release == 8.7.*" -] [envs.release.scripts] +deps = "pip install -r requirements-release.txt" bump = "semantic-release -v --strict version --no-push --no-commit --no-tag --skip-build {args}" version = "semantic-release -v --strict version --print {args}" diff --git a/pyproject.toml b/pyproject.toml index 9baa13d..6537f1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,22 @@ dynamic = ["version"] readme = "README.md" license = "Apache-2.0" requires-python = ">=3.9" +description = "A python library for building adaptors that integrate applications with Open Job Description jobs" +# https://pypi.org/classifiers/ +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Operating System :: MacOS", + "License :: OSI Approved :: Apache Software License", + "Intended Audience :: Developers", +] dependencies = [ "pyyaml ~= 6.0", diff --git a/requirements-release.txt b/requirements-release.txt index 2f7766c..5d3eed6 100644 --- a/requirements-release.txt +++ b/requirements-release.txt @@ -1,3 +1 @@ -# HACK: This file solely exists for dependabot checks. The actual dependencies are in `hatch.toml` in the `release` environment. -# If dependabot opens a PR that modifies this file, please make sure to update the coresponding dependency in `hatch.toml` as well. -python-semantic-release == 8.7.* \ No newline at end of file +python-semantic-release == 9.0.* \ No newline at end of file diff --git a/requirements-testing.txt b/requirements-testing.txt index 5f6bd58..f7e6295 100644 --- a/requirements-testing.txt +++ b/requirements-testing.txt @@ -4,7 +4,7 @@ pytest == 7.4.* pytest-cov == 4.1.* pytest-timeout == 2.3.* pytest-xdist == 3.5.* -black == 23.* +black == 24.* ruff == 0.3.* mypy == 1.8.* psutil == 5.9.* diff --git a/src/openjd/adaptor_runtime/_entrypoint.py b/src/openjd/adaptor_runtime/_entrypoint.py index f3ec7ef..6c4ab8c 100644 --- a/src/openjd/adaptor_runtime/_entrypoint.py +++ b/src/openjd/adaptor_runtime/_entrypoint.py @@ -181,9 +181,9 @@ def _get_integration_data(self, parsed_args: Namespace) -> _IntegrationData: return _IntegrationData( init_data=parsed_args.init_data if hasattr(parsed_args, "init_data") else {}, run_data=parsed_args.run_data if hasattr(parsed_args, "run_data") else {}, - path_mapping_data=parsed_args.path_mapping_rules - if hasattr(parsed_args, "path_mapping_rules") - else {}, + path_mapping_data=( + parsed_args.path_mapping_rules if hasattr(parsed_args, "path_mapping_rules") else {} + ), ) def start(self, reentry_exe: Optional[Path] = None) -> None: diff --git a/test/openjd/adaptor_runtime/integ/adaptors/configuration/test_configuration.py b/test/openjd/adaptor_runtime/integ/adaptors/configuration/test_configuration.py index a6faf22..8cbb64b 100644 --- a/test/openjd/adaptor_runtime/integ/adaptors/configuration/test_configuration.py +++ b/test/openjd/adaptor_runtime/integ/adaptors/configuration/test_configuration.py @@ -28,9 +28,10 @@ def test_loads_config(self): try: # GIVEN - with tempfile.NamedTemporaryFile( - mode="w+", delete=False - ) as schema_file, tempfile.NamedTemporaryFile(mode="w+", delete=False) as config_file: + with ( + tempfile.NamedTemporaryFile(mode="w+", delete=False) as schema_file, + tempfile.NamedTemporaryFile(mode="w+", delete=False) as config_file, + ): json.dump(json_schema, schema_file.file) json.dump(config, config_file.file) schema_file.seek(0) diff --git a/test/openjd/adaptor_runtime/integ/adaptors/configuration/test_configuration_manager.py b/test/openjd/adaptor_runtime/integ/adaptors/configuration/test_configuration_manager.py index 4f1e181..12276c5 100644 --- a/test/openjd/adaptor_runtime/integ/adaptors/configuration/test_configuration_manager.py +++ b/test/openjd/adaptor_runtime/integ/adaptors/configuration/test_configuration_manager.py @@ -74,13 +74,13 @@ def test_builds_config(self, json_schema_file: IO[str]): homedir = os.path.expanduser("~") try: - with tempfile.NamedTemporaryFile( - mode="w+", delete=False - ) as default_config_file, tempfile.NamedTemporaryFile( - mode="w+", delete=False - ) as system_config_file, tempfile.NamedTemporaryFile( - mode="w+", dir=homedir, delete=False - ) as user_config_file: + with ( + tempfile.NamedTemporaryFile(mode="w+", delete=False) as default_config_file, + tempfile.NamedTemporaryFile(mode="w+", delete=False) as system_config_file, + tempfile.NamedTemporaryFile( + mode="w+", dir=homedir, delete=False + ) as user_config_file, + ): json.dump(default_config, default_config_file) json.dump(system_config, system_config_file) json.dump(user_config, user_config_file) diff --git a/test/openjd/adaptor_runtime/unit/test_entrypoint.py b/test/openjd/adaptor_runtime/unit/test_entrypoint.py index bdd19c0..8ae766a 100644 --- a/test/openjd/adaptor_runtime/unit/test_entrypoint.py +++ b/test/openjd/adaptor_runtime/unit/test_entrypoint.py @@ -74,9 +74,10 @@ def test_errors_with_no_command( self, mock_adaptor_cls: MagicMock, capsys: pytest.CaptureFixture[str] ): # GIVEN - with patch.object(runtime_entrypoint.sys, "argv", ["Adaptor"]), patch.object( - argparse._sys, "exit" # type: ignore - ) as sys_exit: + with ( + patch.object(runtime_entrypoint.sys, "argv", ["Adaptor"]), + patch.object(argparse._sys, "exit") as sys_exit, # type: ignore + ): entrypoint = EntryPoint(mock_adaptor_cls) # WHEN @@ -151,20 +152,21 @@ def test_bad_version_string( def exit(): raise Exception - with patch.object( - runtime_entrypoint.sys, - "argv", - [ - "Adaptor", - "is-compatible", - "--openjd-adaptor-cli-version", - str(runtime_entrypoint._ADAPTOR_CLI_VERSION), - "--integration-data-interface-version", - "1.0.0", - ], - ), patch.object( - argparse._sys, "exit" # type: ignore - ) as sys_exit: + with ( + patch.object( + runtime_entrypoint.sys, + "argv", + [ + "Adaptor", + "is-compatible", + "--openjd-adaptor-cli-version", + str(runtime_entrypoint._ADAPTOR_CLI_VERSION), + "--integration-data-interface-version", + "1.0.0", + ], + ), + patch.object(argparse._sys, "exit") as sys_exit, # type: ignore + ): entrypoint = EntryPoint(mock_adaptor_cls) # WHEN @@ -183,20 +185,21 @@ def test_is_not_compatible( integration_version: str, ): # GIVEN - with patch.object( - runtime_entrypoint.sys, - "argv", - [ - "Adaptor", - "is-compatible", - "--openjd-adaptor-cli-version", - str(runtime_entrypoint._ADAPTOR_CLI_VERSION), - "--integration-data-interface-version", - integration_version, - ], - ), patch.object( - argparse._sys, "exit" # type: ignore - ) as sys_exit: + with ( + patch.object( + runtime_entrypoint.sys, + "argv", + [ + "Adaptor", + "is-compatible", + "--openjd-adaptor-cli-version", + str(runtime_entrypoint._ADAPTOR_CLI_VERSION), + "--integration-data-interface-version", + integration_version, + ], + ), + patch.object(argparse._sys, "exit") as sys_exit, # type: ignore + ): entrypoint = EntryPoint(mock_adaptor_cls) # WHEN diff --git a/test/openjd/adaptor_runtime_client/unit/test_client_interface.py b/test/openjd/adaptor_runtime_client/unit/test_client_interface.py index 348dddf..5cd6e1c 100644 --- a/test/openjd/adaptor_runtime_client/unit/test_client_interface.py +++ b/test/openjd/adaptor_runtime_client/unit/test_client_interface.py @@ -349,13 +349,17 @@ class TestWindowsClientInterface: def patched_named_pipe_helper( self, ) -> Generator[Tuple[MagicMock, MagicMock, MagicMock], None, None]: - with patch.object( - win_client_interface.NamedPipeHelper, "write_to_pipe" - ) as mock_write_to_pipe, patch.object( - win_client_interface.NamedPipeHelper, "establish_named_pipe_connection" - ) as mock_establish_named_pipe_connection, patch.object( - win_client_interface.NamedPipeHelper, "read_from_pipe" - ) as mock_read_from_pipe: + with ( + patch.object( + win_client_interface.NamedPipeHelper, "write_to_pipe" + ) as mock_write_to_pipe, + patch.object( + win_client_interface.NamedPipeHelper, "establish_named_pipe_connection" + ) as mock_establish_named_pipe_connection, + patch.object( + win_client_interface.NamedPipeHelper, "read_from_pipe" + ) as mock_read_from_pipe, + ): yield mock_write_to_pipe, mock_establish_named_pipe_connection, mock_read_from_pipe @pytest.mark.parametrize(