Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ FROM python:3.12.2 AS base
# [tool.poetry.dependencies]

# make sure to update build.system.requries poetry version in pyproject.toml
ENV POETRY_VERSION="1.7.1"
ENV POETRY_VERSION="1.8.1"
ENV POETRY_HOME="/opt/poetry"

ENV PATH="$POETRY_HOME/bin:$PATH"

RUN pip install --upgrade pip==23.3.2
RUN pip install --upgrade pip==24.0
RUN pip install poetry==$POETRY_VERSION

COPY poetry.lock poetry.lock
Expand Down
18 changes: 1 addition & 17 deletions build_support/src/build_support/ci_cd_tasks/build_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
get_pypi_docs_src_dir,
get_pypi_src_dir,
get_sphinx_conf_dir,
get_temp_dist_dir,
)
from build_support.ci_cd_vars.project_setting_vars import (
get_project_name,
Expand Down Expand Up @@ -120,22 +119,7 @@ def run(self) -> None:
),
"poetry",
"build",
],
),
)
# TODO @Alec: clean this up once a new version of poetry supporting "-o" is
# released
# https://github.com/alec-g-olson/TemplatePythonProject/issues/64
run_process(
args=concatenate_args(
args=[
get_docker_command_for_image(
non_docker_project_root=self.non_docker_project_root,
docker_project_root=self.docker_project_root,
target_image=DockerTarget.PROD,
),
"mv",
get_temp_dist_dir(project_root=self.docker_project_root),
"--output",
get_dist_dir(project_root=self.docker_project_root),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,18 +469,6 @@ def get_git_info_yaml(project_root: Path) -> Path:
return get_build_dir(project_root=project_root).joinpath("git_info.yaml")


def get_temp_dist_dir(project_root: Path) -> Path:
"""Gets the temporary dist dir for the project.

Args:
project_root (Path): Path to this project's root.

Returns:
Path: Path to temporary dist dir for the project.
"""
return maybe_build_dir(dir_to_build=project_root.joinpath("dist"))


########################################
# Files and folder collections that span domains
########################################
Expand Down
14 changes: 1 addition & 13 deletions build_support/test/ci_cd_tasks/test_build_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
get_pypi_docs_src_dir,
get_pypi_src_dir,
get_sphinx_conf_dir,
get_temp_dist_dir,
)
from build_support.ci_cd_vars.project_setting_vars import (
get_project_name,
Expand Down Expand Up @@ -138,17 +137,7 @@ def test_run_build_pypi(
),
"poetry",
"build",
],
)
mv_dist_to_final_location_args = concatenate_args(
args=[
get_docker_command_for_image(
non_docker_project_root=mock_project_root,
docker_project_root=docker_project_root,
target_image=DockerTarget.PROD,
),
"mv",
get_temp_dist_dir(project_root=docker_project_root),
"--output",
get_dist_dir(project_root=docker_project_root),
],
)
Expand All @@ -161,7 +150,6 @@ def test_run_build_pypi(
expected_run_process_calls = [
call(args=clean_dist_args),
call(args=poetry_build_args),
call(args=mv_dist_to_final_location_args),
]
assert run_process_mock.call_count == len(expected_run_process_calls)
run_process_mock.assert_has_calls(calls=expected_run_process_calls)
Expand Down
12 changes: 0 additions & 12 deletions build_support/test/ci_cd_vars/test_file_and_dir_path_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
get_pypi_test_dir,
get_pyproject_toml,
get_sphinx_conf_dir,
get_temp_dist_dir,
maybe_build_dir,
)
from build_support.dag_engine import concatenate_args
Expand Down Expand Up @@ -168,17 +167,6 @@ def test_get_git_info_yaml(mock_project_root: Path) -> None:
).joinpath("git_info.yaml")


def test_get_temp_dist_dir(mock_project_root: Path) -> None:
expected_temp_dist_dir = mock_project_root.joinpath("dist")
assert not expected_temp_dist_dir.exists()
assert get_temp_dist_dir(project_root=mock_project_root) == expected_temp_dist_dir
assert expected_temp_dist_dir.exists()

assert get_temp_dist_dir(
project_root=mock_project_root,
) == mock_project_root.joinpath("dist")


def test_get_all_non_pulumi_python_folders(mock_project_root: Path) -> None:
assert get_all_non_pulumi_python_folders(
project_root=mock_project_root,
Expand Down
30 changes: 15 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ enable_error_code = ["ignore-without-code"]

[tool.poetry]
name = "template_python_project"
version = "0.2.21"
version = "0.2.22"
license = "unlicense"
packages = [{include = "template_python_project", from="pypi_package/src"}]
description = "A project that can be used as a template to provide some CI/CD out of the box."
Expand Down