Skip to content

Commit

Permalink
chore: add pypi classifiers (#102)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles Moore <122481442+moorec-aws@users.noreply.github.com>
  • Loading branch information
moorec-aws committed Mar 31, 2024
1 parent 0adc478 commit 09e4e2b
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 58 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions requirements-release.txt
Original file line number Diff line number Diff line change
@@ -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.*
python-semantic-release == 9.0.*
2 changes: 1 addition & 1 deletion requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down
6 changes: 3 additions & 3 deletions src/openjd/adaptor_runtime/_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
65 changes: 34 additions & 31 deletions test/openjd/adaptor_runtime/unit/test_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 11 additions & 7 deletions test/openjd/adaptor_runtime_client/unit/test_client_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 09e4e2b

Please sign in to comment.