Skip to content

Conversation

kenodegard
Copy link
Contributor

@kenodegard kenodegard commented Jul 31, 2025

Description

Extracted smaller fixes from #12771 in order to get them included in 25.7.0 release.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jul 31, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in 🔎 Review Jul 31, 2025
@@ -308,4 +308,4 @@ def print_result(args, prefix, result):
actions["PIP"] = result["pip"]
common.stdout_json_success(prefix=prefix, actions=actions)
else:
install.print_activate(args.name or prefix)
common.print_activate(args.name or prefix)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conda/conda/cli/install.py

Lines 158 to 162 in 08c7e5d

@deprecated("25.9", "26.3", addendum="Use conda.cli.common.print_activate()")
def print_activate(env_name_or_prefix): # pragma: no cover
from .common import print_activate as _print_activate
_print_activate(env_name_or_prefix)

@@ -208,7 +208,7 @@ def set_all_logger_level(level=DEBUG):
@cache
def set_file_logging(logger_name=None, level=DEBUG, path=None):
if path is None:
timestamp = datetime.utcnow().strftime("%Y%m%d-%H%M%S")
timestamp = datetime.now(datetime.UTC).strftime("%Y%m%d-%H%M%S")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timestamp = datetime.now(datetime.UTC).strftime("%Y%m%d-%H%M%S")
timestamp = datetime.now(timezone.utc).strftime("%Y%m%d-%H%M%S")

datetime.UTC was only added in 3.11, but datetime.timezone.utc in Python 3.2. Let's use datetime.timezone.utc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -12,7 +12,8 @@
import pytest

from conda.common.path import get_python_site_packages_short_path
from conda.common.pkg_formats.python import (
from conda.common.url import join_url
from conda.plugins.prefix_data_loaders.pypi.pkg_format import (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deprecated.module(
"25.9",
"26.3",
addendum="Use 'conda.plugins.prefix_data_loaders.pypi.pkg_format' hook instead",
)

@@ -535,7 +536,7 @@ def test_noarch_python_package_with_entry_points(
entry point script, "pygmentize".
"""
with tmp_env("pygments") as prefix:
py_ver = get_python_version_for_prefix(prefix)
py_ver = get_major_minor_version(PrefixData(prefix).get("python", None).version)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deprecated("25.9", "26.3", addendum="Use `PrefixData.get('python').version` instead.")
def get_python_version_for_prefix(prefix: os.PathLike) -> str | None:
"""
For the given conda prefix, return the version of the Python installation
in that prefix.
"""
# returns a string e.g. "2.7", "3.4", "3.5" or None
record = PrefixData(prefix).get("python", None)
if record is not None:
if record.version[3].isdigit():
return record.version[:4]
else:
return record.version[:3]
return None

@@ -114,7 +114,6 @@ def test_resume_download(tmp_path):
responses.add(
responses.GET,
url_pattern,
stream=True,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

codspeed-hq bot commented Jul 31, 2025

CodSpeed Instrumentation Performance Report

Merging #15062 will not alter performance

Comparing kenodegard:minor-fixes (540fe2a) with main (08c7e5d)

Summary

✅ 21 untouched benchmarks

@kenodegard kenodegard moved this from 🆕 New to 🏗️ In Progress in 🔎 Review Jul 31, 2025
@kenodegard kenodegard added this to the 25.7.x milestone Jul 31, 2025
@kenodegard kenodegard marked this pull request as ready for review July 31, 2025 22:00
@kenodegard kenodegard requested a review from a team as a code owner July 31, 2025 22:00
@kenodegard kenodegard moved this from 🏗️ In Progress to 👀 In Review in 🔎 Review Jul 31, 2025
* Mark `conda.gateways.disk.create.create_application_entry_point` as pending deprecation, to be removed in 26.9. (#15062)
* Mark `conda.gateways.disk.create.ProgressFileWrapper` as pending deprecation, to be removed in 26.9. (#15062)
* Mark `conda.gateways.disk.create.create_fake_executable_softlink` as pending deprecation, to be removed in 26.9. (#15062)
* Postpone `conda.env.specs.binstar` deprecation to 26.9. (#15062)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@@ -208,7 +208,7 @@ def set_all_logger_level(level=DEBUG):
@cache
def set_file_logging(logger_name=None, level=DEBUG, path=None):
if path is None:
timestamp = datetime.utcnow().strftime("%Y%m%d-%H%M%S")
timestamp = datetime.now(datetime.UTC).strftime("%Y%m%d-%H%M%S")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timestamp = datetime.now(datetime.UTC).strftime("%Y%m%d-%H%M%S")
timestamp = datetime.now(timezone.utc).strftime("%Y%m%d-%H%M%S")

datetime.UTC was only added in 3.11, but datetime.timezone.utc in Python 3.2. Let's use datetime.timezone.utc

@github-project-automation github-project-automation bot moved this from 👀 In Review to 🏗️ In Progress in 🔎 Review Aug 1, 2025
@github-project-automation github-project-automation bot moved this from 🏗️ In Progress to ✅ Approved in 🔎 Review Aug 1, 2025
@jezdez jezdez enabled auto-merge (squash) August 1, 2025 09:08
@jezdez jezdez merged commit 80779e9 into conda:main Aug 1, 2025
141 of 143 checks passed
@github-project-automation github-project-automation bot moved this from ✅ Approved to 🏁 Done in 🔎 Review Aug 1, 2025
@kenodegard kenodegard deleted the minor-fixes branch August 1, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants