Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python-userpath
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian Python Team
packages
python-userpath
Commits
00bb228a
Commit
00bb228a
authored
1 year ago
by
Stefano Rivera
Browse files
Options
Downloads
Patches
Plain Diff
New upstream version 1.9.0
parent
6c1f975d
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
HISTORY.rst
+7
-0
7 additions, 0 deletions
HISTORY.rst
pyproject.toml
+1
-0
1 addition, 0 deletions
pyproject.toml
userpath/__init__.py
+1
-1
1 addition, 1 deletion
userpath/__init__.py
userpath/shells.py
+5
-8
5 additions, 8 deletions
userpath/shells.py
userpath/utils.py
+1
-1
1 addition, 1 deletion
userpath/utils.py
with
15 additions
and
10 deletions
HISTORY.rst
+
7
−
0
View file @
00bb228a
...
...
@@ -4,10 +4,17 @@ History
master
^^^^^^
1.9.0
^^^^^
- Ignore the current directory for path detection on Windows
- On non-Windows systems only modify login shells
1.8.0
^^^^^
- Broadcast WM_SETTINGCHANGE on Windows
- zsh: respect ZDOTDIR env var
- Drop Python 2.7 & 3.6
1.7.0
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
0
View file @
00bb228a
...
...
@@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.8"
,
"Programming Language :: Python :: 3.9"
,
"Programming Language :: Python :: 3.10"
,
"Programming Language :: Python :: 3.11"
,
"Programming Language :: Python :: Implementation :: CPython"
,
"Programming Language :: Python :: Implementation :: PyPy"
,
]
...
...
This diff is collapsed.
Click to expand it.
userpath/__init__.py
+
1
−
1
View file @
00bb228a
from
.core
import
append
,
in_new_path
,
need_shell_restart
,
prepend
from
.utils
import
in_current_path
__version__
=
'
1.
8
.0
'
__version__
=
'
1.
9
.0
'
This diff is collapsed.
Click to expand it.
userpath/shells.py
+
5
−
8
View file @
00bb228a
...
...
@@ -30,8 +30,6 @@ class Bash(Shell):
new_path
=
'
{}{}{}
'
.
format
(
head
,
pathsep
,
tail
)
contents
=
'
export PATH=
"
{}
"'
.
format
(
new_path
)
configs
=
{
path
.
join
(
self
.
home
,
'
.bashrc
'
):
contents
}
# https://github.com/ofek/userpath/issues/3#issuecomment-492491977
profile_path
=
path
.
join
(
self
.
home
,
'
.profile
'
)
bash_profile_path
=
path
.
join
(
self
.
home
,
'
.bash_profile
'
)
...
...
@@ -44,13 +42,11 @@ class Bash(Shell):
# Terminal.app runs a login shell by default for each new terminal window.
login_config
=
bash_profile_path
configs
[
login_config
]
=
contents
return
configs
return
{
login_config
:
contents
}
@classmethod
def
show_path_commands
(
cls
):
return
[[
'
bash
'
,
'
-i
'
,
'
-c
'
,
'
echo $PATH
'
],
[
'
bash
'
,
'
-i
'
,
'
-l
'
,
'
-c
'
,
'
echo $PATH
'
]]
return
[[
'
bash
'
,
'
-i
'
,
'
-l
'
,
'
-c
'
,
'
echo $PATH
'
]]
class
Fish
(
Shell
):
...
...
@@ -95,11 +91,12 @@ class Zsh(Shell):
contents
=
'
export PATH=
"
{}
"'
.
format
(
new_path
)
zdotdir
=
environ
.
get
(
'
ZDOTDIR
'
,
self
.
home
)
return
{
path
.
join
(
zdotdir
,
'
.zshrc
'
):
contents
,
path
.
join
(
zdotdir
,
'
.zprofile
'
):
contents
}
return
{
path
.
join
(
zdotdir
,
'
.zprofile
'
):
contents
}
@classmethod
def
show_path_commands
(
cls
):
return
[[
'
zsh
'
,
'
-i
'
,
'
-c
'
,
'
echo $PATH
'
],
[
'
zsh
'
,
'
-i
'
,
'
-l
'
,
'
-c
'
,
'
echo $PATH
'
]]
return
[[
'
zsh
'
,
'
-i
'
,
'
-l
'
,
'
-c
'
,
'
echo $PATH
'
]]
SHELLS
=
{
...
...
This diff is collapsed.
Click to expand it.
userpath/utils.py
+
1
−
1
View file @
00bb228a
...
...
@@ -16,7 +16,7 @@ def normpath(location):
def
location_in_path
(
location
,
path
):
return
normpath
(
location
)
in
(
normpath
(
p
)
for
p
in
path
.
split
(
os
.
pathsep
))
return
normpath
(
location
)
in
(
normpath
(
p
)
for
p
in
path
.
split
(
os
.
pathsep
)
if
p
!=
''
)
def
in_current_path
(
location
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment