Skip to content

Commit

Permalink
fix dups and remove occurrance of incompatible API
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Mar 12, 2024
1 parent 7a4f603 commit 400f015
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
6 changes: 3 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## 4.0.2 (unreleased)


- Nothing changed yet.

- Fix #42: deprecated use of `pkg_resoures` to load entry points and parse requirements.
This enables mxdev to work on Python 3.12, where `pkg_resources` is no longer installed by default in virtual_envs.
[jensens]

## 4.0.1 (2024-03-01)

Expand Down
2 changes: 1 addition & 1 deletion src/mxdev/entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ def load_eps_by_group(group: str) -> list:
# XXX: for some reasons entry points are loaded twice. not sure if this
# is a glitch when installing with uv or something related to
# importlib.metadata.entry_points
return list(eps) # type: ignore
return list(set(eps)) # type: ignore
2 changes: 1 addition & 1 deletion src/mxdev/processing.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from .logging import logger
from .state import State
from .vcs.common import WorkingCopies
from packaging.requirements import Requirement
from pathlib import Path
from urllib import parse
from urllib import request
from packaging.requirements import Requirement

import typing

Expand Down
11 changes: 2 additions & 9 deletions src/mxdev/vcs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,12 @@ def get_workingcopytypes() -> typing.Dict[str, typing.Type[BaseWorkingCopy]]:
for entrypoint in load_eps_by_group(group):
key = entrypoint.name
workingcopytype = entrypoint.load()
if not entrypoint.dist:
continue
if entrypoint.dist.name == "mxdev":
_workingcopytypes[key] = workingcopytype
continue
if key in addons:
logger.error(
f"There already is a working copy type addon registered for '{key}'."
f"Duplicate workingcopy types registration '{key}' at "
f"{entrypoint.value} can not override {addons[key]}"
)
sys.exit(1)
logger.info(
f"Overwriting '{key}' with addon from '{entrypoint.dist.project_name}'."
)
addons[key] = workingcopytype
_workingcopytypes.update(addons)
return _workingcopytypes
Expand Down

0 comments on commit 400f015

Please sign in to comment.