nice-path 0.1.3__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nice-path
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Nice formatting of paths
5
5
  Author: Tom Koelman
6
6
  Author-email: Tom Koelman <tkoelman@xs4all.nl>
@@ -27,13 +27,13 @@ relative to the users home directory it will rewrite it to use `~`.
27
27
  from nice_path import nice_path
28
28
  from pathlib import Path
29
29
 
30
- nice_path("/Users/<user>/.config/something") # "~/.config/something"
30
+ nice_path("/Users/<user>/.config/something") # "~/.config/something"
31
31
 
32
- nice_path("/Users/<user>/") # "~"
32
+ nice_path("/Users/<user>/") # "~"
33
33
 
34
- nice_path("/tmp") # "/tmp"
34
+ nice_path("/tmp") # "/tmp"
35
35
 
36
- nice_path(Path("/Users/<user>/Documents")) # "~/Documents"
36
+ nice_path(Path("/Users/<user>/Documents")) # "~/Documents"
37
37
  ```
38
38
 
39
39
  ## License
@@ -9,13 +9,13 @@ relative to the users home directory it will rewrite it to use `~`.
9
9
  from nice_path import nice_path
10
10
  from pathlib import Path
11
11
 
12
- nice_path("/Users/<user>/.config/something") # "~/.config/something"
12
+ nice_path("/Users/<user>/.config/something") # "~/.config/something"
13
13
 
14
- nice_path("/Users/<user>/") # "~"
14
+ nice_path("/Users/<user>/") # "~"
15
15
 
16
- nice_path("/tmp") # "/tmp"
16
+ nice_path("/tmp") # "/tmp"
17
17
 
18
- nice_path(Path("/Users/<user>/Documents")) # "~/Documents"
18
+ nice_path(Path("/Users/<user>/Documents")) # "~/Documents"
19
19
  ```
20
20
 
21
21
  ## License
@@ -0,0 +1,31 @@
1
+ [project]
2
+ name = "nice-path"
3
+ version = "0.1.4"
4
+ description = "Nice formatting of paths"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ dependencies = []
8
+ classifiers = [
9
+ "Programming Language :: Python :: 3",
10
+ "Operating System :: OS Independent",
11
+ "Development Status :: 5 - Production/Stable",
12
+ "Intended Audience :: Developers",
13
+ "Topic :: Software Development :: Libraries :: Python Modules",
14
+ ]
15
+ license = "MIT-0"
16
+ license-files = ["LICENSE"]
17
+
18
+ [[project.authors]]
19
+ name = "Tom Koelman"
20
+ email = "tkoelman@xs4all.nl"
21
+
22
+ [project.urls]
23
+ repository = "https://github.com/tomkoelman/nice-path.git"
24
+ issues = "https://github.com/tomkoelman/nice-path/issues"
25
+
26
+ [build-system]
27
+ requires = ["uv_build>=0.13.7,<0.14.0"]
28
+ build-backend = "uv_build"
29
+
30
+ [dependency-groups]
31
+ dev = ["pytest>=9.0.2"]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nice-path"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = "Nice formatting of paths"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -23,7 +23,7 @@ repository = "https://github.com/tomkoelman/nice-path.git"
23
23
  issues = "https://github.com/tomkoelman/nice-path/issues"
24
24
 
25
25
  [build-system]
26
- requires = ["uv_build>=0.10.7,<0.11.0"]
26
+ requires = ["uv_build>=0.13.7,<0.14.0"]
27
27
  build-backend = "uv_build"
28
28
 
29
29
  [dependency-groups]
@@ -7,10 +7,9 @@ def nice_path(path: Path | str) -> str:
7
7
  home = Path.home()
8
8
  try:
9
9
  rel = p.relative_to(home)
10
- rel_str = str(rel)
11
- if rel_str == ".":
10
+ if str(rel) == ".":
12
11
  return "~"
13
12
  else:
14
- return "~/" + rel_str
13
+ return str(Path("~") / rel)
15
14
  except ValueError:
16
15
  return str(p)
File without changes