Skip to content

Commit

Permalink
Merge pull request #374 from BCG-X-Official/dev/3.0.0
Browse files Browse the repository at this point in the history
 BUILD: release pytools 3.0.0
  • Loading branch information
j-ittner authored Jun 17, 2024
2 parents df3f3cf + c0826e5 commit bded8ec
Show file tree
Hide file tree
Showing 50 changed files with 672 additions and 757 deletions.
7 changes: 7 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ Python 3.11, and drops support for Python versions.
*pytools* 2.1
-------------

2.1.3
~~~~~

- FIX: :class:`.DendrogramMatplotStyle` now calls :meth:`.Axis.set_ticklabels` using a
positional argument for the labels, to address a change in *matplotlib* |nbsp| 3.7


2.1.2
~~~~~

Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ stages:
eval "$(conda shell.bash hook)"
conda install -y anaconda-client
anaconda login --username "${CONDA_USERNAME}" --password "${CONDA_PASSWORD}"
anaconda upload --user bcgx --force $(System.ArtifactsDirectory)/conda_default/conda/noarch/$(package_name)-*.tar.bz2
anaconda upload --user BCG_Gamma --force $(System.ArtifactsDirectory)/conda_default/conda/noarch/$(package_name)-*.tar.bz2
anaconda logout
# set +x to prevent Azure from randomly appending a \' of the ## statement
Expand Down
2 changes: 1 addition & 1 deletion make.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def build(self, exposed_package_dependencies: Mapping[str, str]) -> None:
)

os.makedirs(build_path, exist_ok=True)
build_cmd = f"conda mambabuild -c conda-forge -c bcg_gamma {recipe_path}"
build_cmd = f"conda mambabuild -c conda-forge {recipe_path}"
log(
f"Building: {self.project}\n"
f"Build path: {build_path}\n"
Expand Down
2 changes: 1 addition & 1 deletion src/pytools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
A collection of Python extensions and tools used in BCG GAMMA's open-source libraries.
"""

__version__ = "3.0rc1"
__version__ = "3.0.0"
29 changes: 9 additions & 20 deletions src/pytools/api/_alltracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,9 @@

import logging
import re
from collections.abc import Callable, Collection, Iterable
from types import FunctionType
from typing import (
Any,
Callable,
Collection,
Dict,
Iterable,
List,
Optional,
Set,
TypeVar,
Union,
get_type_hints,
)
from typing import Any, TypeVar, get_type_hints

from typing_inspect import get_args, is_forward_ref

Expand Down Expand Up @@ -93,9 +82,9 @@ class AllTracker:
# noinspection PyShadowingNames
def __init__(
self,
globals_: Dict[str, Any],
globals_: dict[str, Any],
*,
public_module: Optional[str] = None,
public_module: str | None = None,
update_forward_references: bool = True,
allow_global_constants: bool = False,
allow_imported_definitions: bool = False,
Expand Down Expand Up @@ -199,7 +188,7 @@ def validate(self) -> None:
# objects without a __dict__ will not permit setting the public module
pass

def get_tracked(self) -> List[str]:
def get_tracked(self) -> list[str]:
"""
List the names of all locally tracked, public items.
Expand Down Expand Up @@ -312,7 +301,7 @@ def public_module_prefix(module_name: str) -> str:


def update_forward_references(
obj: Union[type, FunctionType], *, globals_: Optional[Dict[str, Any]] = None
obj: type | FunctionType, *, globals_: dict[str, Any] | None = None
) -> None:
"""
Replace all forward references with their referenced classes.
Expand All @@ -328,10 +317,10 @@ def update_forward_references(
return

# keep track of classes we already visited to prevent infinite recursion
visited: Set[type] = set()
visited: set[type] = set()

def _update(
_obj: Union[type, FunctionType], local_ns: Optional[Dict[str, Any]] = None
_obj: type | FunctionType, local_ns: dict[str, Any] | None = None
) -> None:
if isinstance(_obj, type) and _obj.__module__ == my_module:
if _obj not in visited:
Expand All @@ -345,7 +334,7 @@ def _update(
_update_annotations(_obj, local_ns)

def _update_annotations(
_obj: Union[type, FunctionType], local_ns: Optional[Dict[str, Any]]
_obj: type | FunctionType, local_ns: dict[str, Any] | None
) -> None:
# unwrap the object to get the underlying function, if applicable
while isinstance(_obj, FunctionType):
Expand Down
Loading

0 comments on commit bded8ec

Please sign in to comment.