Skip to content

Commit

Permalink
Update imports & aliases (#195)
Browse files Browse the repository at this point in the history
* Remove `basedpyright` aliases, add `cyber_jp`

* update lazy

* update
  • Loading branch information
dycw authored Oct 25, 2024
1 parent 7e2cb27 commit dbe8d22
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[bumpversion]
current_version = 0.1.192
current_version = 0.1.193
1 change: 0 additions & 1 deletion install-mac.conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@
- [brew install --cask google-chrome, Installing Google Chrome]
- [brew install --cask libreoffice, Installing LibreOffice]
- [brew install --cask postico, Installing Postico 2]
- [brew install --cask protonvpn, Installing ProtonVPN]
- [brew install --cask spotify, Installing Spotify]
- [brew install --cask transmission, Installing Transmission]
- [
Expand Down
15 changes: 13 additions & 2 deletions ipython/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@
Literal,
NewType,
NoReturn,
NotRequired,
ParamSpec,
Protocol,
Required,
TextIO,
TypeAlias,
TypedDict,
Expand Down Expand Up @@ -194,10 +196,12 @@
Mapping,
NewType,
NoReturn,
NotRequired,
ParamSpec,
Path,
Pool,
Protocol,
Required,
Sequence,
Sized,
TemporaryDirectory,
Expand Down Expand Up @@ -1419,11 +1423,18 @@


try:
from whenever import Date, DateTimeDelta, LocalDateTime, Time, ZonedDateTime
from whenever import (
Date,
DateTimeDelta,
LocalDateTime,
Time,
TimeDelta,
ZonedDateTime,
)
except ModuleNotFoundError:
pass
else:
_ = [Date, DateTimeDelta, LocalDateTime, Time, ZonedDateTime]
_ = [Date, DateTimeDelta, LocalDateTime, Time, ZonedDateTime, TimeDelta]
try:
from utilities.whenever import (
ensure_date,
Expand Down
12 changes: 6 additions & 6 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"conform.nvim": {
"branch": "master",
"commit": "51e99efa1675bd003a549fb02244b0a54e8de800"
"commit": "5fbea7d7043bae2499d643c97b407f6da44abff4"
},
"dial.nvim": {
"branch": "master",
Expand All @@ -53,7 +53,7 @@
},
"fzf-lua": {
"branch": "main",
"commit": "5dec364c9dedec00dcd6d06e323d7bc7f8d6b596"
"commit": "fc0f2b5781587d388b743c2c114127a7036d1a31"
},
"gitsigns.nvim": {
"branch": "main",
Expand Down Expand Up @@ -149,7 +149,7 @@
},
"nvim-lspconfig": {
"branch": "master",
"commit": "0d62a16429dba5fded93a076237079b81527e8f3"
"commit": "edd9591199d1c78c0cb20514231f7f936f9412a2"
},
"nvim-neoclip.lua": {
"branch": "main",
Expand All @@ -173,7 +173,7 @@
},
"nvim-treesitter": {
"branch": "master",
"commit": "bab7b0f20bd3e805b77231a77f516c7d69382693"
"commit": "9210b9a4fa106247333495e19c843710f4d62102"
},
"nvim-treesitter-context": {
"branch": "master",
Expand Down Expand Up @@ -217,11 +217,11 @@
},
"tokyonight.nvim": {
"branch": "main",
"commit": "4867d10ead04e69872b24818d0d306539305cf87"
"commit": "19f39b53ef5e148bf94ea3696df36175af7e31e6"
},
"trouble.nvim": {
"branch": "main",
"commit": "e45a7cb618ed4e84b28d7478c7db60bad9e142c2"
"commit": "2f3b537f2207ce32f4459f9d56746ee013b5e01b"
},
"vim-caser": {
"branch": "master",
Expand Down
10 changes: 10 additions & 0 deletions nvim/lua/snippets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,10 @@ ls.add_snippets("python", {
s("ty-cast", { t({ "from typing import cast", "" }) }),
s("ty-generic", { t({ "from typing import Generic", "" }) }),
s("ty-literal", { t({ "from typing import Literal", "" }) }),
s("ty-not-required", { t({ "from typing import NotRequired", "" }) }),
s("ty-overload", { t({ "from typing import overload", "" }) }),
s("ty-protocol", { t({ "from typing import Protocol", "" }) }),
s("ty-required", { t({ "from typing import Required", "" }) }),
s("ty-type-var", { t({ "from typing import TypeVar", "" }) }),
s("ty-typed-dict", { t({ "from typing import TypedDict", "" }) }),

Expand Down Expand Up @@ -339,6 +341,14 @@ ls.add_snippets("python", {
s("ut-writer", { t({ "from utilities.atomicwrites import writer", "" }) }),
s("ut-zoned-datetime", { t({ "from utilities.polars import zoned_datetime", "" }) }),

-- whenever
s("wh-date-delta", { t({ "from whenever import DateDelta", "" }) }),
s("wh-date-time-delta", { t({ "from whenever import DateTimeDelta", "" }) }),
s("wh-local-date-time", { t({ "from whenever import LocalDateTime", "" }) }),
s("wh-time", { t({ "from whenever import Time", "" }) }),
s("wh-time-delta", { t({ "from whenever import TimeDelta", "" }) }),
s("wh-zoned-date-time", { t({ "from whenever import ZonedDateTime", "" }) }),

-- zoneinfo
s("zo-zoneinfo", { t({ "from zoneinfo import ZoneInfo", "" }) }),
})
7 changes: 3 additions & 4 deletions shell/common.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/usr/bin/env sh
# shellcheck source=/dev/null

# basedpyright
bpyr() { basedpyright "$@"; }
bpyrw() { bpyr -w "$@"; }

# bat
if command -v bat >/dev/null 2>&1; then
cat() { bat "$@"; }
Expand Down Expand Up @@ -46,6 +42,9 @@ chown_dirs() { find . -type d -exec chown "$1" {} \;; }
# coverage
alias open-cov='open .coverage/html/index.html'

# cyberghost
cyber_jp() { sudo cyberghostvpn --country-code JP --connect; }

# direnv
if command -v direnv >/dev/null 2>&1; then
alias dea='direnv allow'
Expand Down

0 comments on commit dbe8d22

Please sign in to comment.