Skip to content

Commit 50c99b9

Browse files
committed
update mkabs function, version bump
1 parent f65569f commit 50c99b9

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

docs/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.
44

5+
## [0.8.0] - Unreleased
6+
### Changed
7+
- Expanded `mkabs` function to handle more cases
8+
- Allow `is_url` to work on Path objects
9+
510
## [0.7.0] - 2024-01-02
611

712
### Added
813
- Experimental support for three-locking.
914

15+
1016
## [0.6.3] - 2023-08-08
1117
### Fixed
1218
- Incorrect read of registry path. [Issue 35](https://github.com/pepkit/ubiquerg/issues/35)

ubiquerg/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.7.0"
1+
__version__ = "0.8.0"

ubiquerg/paths.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ def parse_registry_path(
8181
return parsed_identifier
8282

8383

84-
def mkabs(path, reldir=None):
84+
def mkabs(path:str, reldir:str =None) -> str:
8585
"""
8686
Makes sure a path is absolute; if not already absolute, it's made absolute
87-
relative to a given directory. Also expands ~ and environment variables for
87+
relative to a given directory (or file). Also expands ~ and environment variables for
8888
kicks.
8989
9090
:param str path: Path to make absolute
@@ -109,4 +109,7 @@ def xpand(path):
109109
if not reldir:
110110
return os.path.abspath(xpand(path))
111111

112-
return os.path.join(xpand(reldir), xpand(path))
112+
if os.path.isdir(reldir):
113+
return os.path.join(xpand(reldir), xpand(path))
114+
else:
115+
return os.path.join(xpand(os.path.dirname(reldir)), xpand(path))

0 commit comments

Comments
 (0)