Releases: nimpylib/pylib
Releases · nimpylib/pylib
Windows support; PyOSError added; sys.audit; more os api...
v0.9.10 - 2025-04-27
Full Changelog: v0.9.9...v0.9.10
This version is tested against Windows. And:
- PyOSError is added over Nim's OSError
- sys.audit is introduced
- more os api...
Bug Fixes
- py:
- io.flush raises OSError on SIGXFSZ. (5f26625)
- audit funcs; .... (1ad6d96)
with
for os.ScandirIterator; addfollow_symlinks
for DirEntry.stat. (85ee4ec)- OSError([arg]): works. (ac0d459)
stat_result
lacksst_file_attributes
,st_reparse_tag
on Windows. (42acad3)- os.makedirs
exist_ok
wasexists_ok
. (e48a60a)
- bool:
- pyconfig:
- windows:
Lib
- unittest:
- resource:
- signal:
- stat:
stat.S_IMODE
not compile for Mode. (4625dcc)
- stat,os.chmod,os.symlink:
- not compile on Windows. (c626c08)
- os:
- shutils:
- SameFileError not of PyOSError. (e8d93be)
- time:
- sleep: add audit; fix 1 ms offset. (4531bb9)
JS
- Lib/os:
- oserr/errmap: not compile. (48d0fc3)
- os: just import causes not compile. (7fc1a2e)
- bypass(NIM-BUG): nim 2.2.4/2.3.1 disallows NonVarDestructor when js. (b3c8121)
- denoAttrs:deno detect was reverted, import* not support str as arg. (3153a57)
Feature additions
builtins
Lib
- os:
- chmod. (8b96d95)
- getppid. (ac405b0)
- umask. (84c218f)
- lstat, stat with
dir_fd
,follow_symlinks
& fstat. (01b6095) - exp
supports_*
. (fa4d969) - unlink,remove supports
dir_fd
. (8af12d9) - rmdir supports
dir_fd
. (4b14bbf) - scandir supports fd as path. (af5991a)
- DirEntry.
is_junction
. (1b1653d) - walk supports
followlinks=walk_symlinks_as_files
. (2b58ce2) - supports_*.issupperset. (fa0e500)
- uname. (50156e6)
- os.path:
- samestat. (e979be2)
- unittest:
- sys:
- shutil:
- rmtree. (8110d1a)
- EXT:
- stat.S_I*(Mode): bool. (86698e4)
inner
- pyconfig:
builtin_available
,check_func_runtime
. (ac14e44) - version: wrapPySince, templWrapExportSincePy. (d040f7a)
Python/config_read_env
. (5d0659d)- sugar:
impr
- Lib/signal: use
AC_CHECK_FUNCS
. (8e69446)
refine
- Lib: use wrapExportSincePy if possible. (a0011fa)
- win: dedup
IO_REPARSE_TAG_SYMLINK
,IO_REPARSE_TAG_MOUNT_POINT
. (2b26c30)
refactor
- Lib/shutil: split to
shutil_impl
; addn_shutil
. (2544eea)
v0.9.9: patches for v0.9.8, prepare for next release
Full Changelog: v0.9.8...v0.9.9
break
- oserr: unexport pathsAsOne, new tryOsOp accepts 2 or 0 paths (3f1f114)
- slice: toNimSlice is no longer a cvt; cvt toPySlice from PySlice1. (c9518e8)
Bug Fixes
- Lib/sys:
- float_repr_style not export (21b7f79)
- sugar:
- list:
- builtins.slice: toNimSlice's assert not work. (903c1cd)
- initVal_with_handle_signal:
- fixup! refact(os_impl): Py_get_osfhandle_noraise to util/get_osfhandle. (0f51997)
JS
- pyerrors.oserr: new catchJsErrAndSetErrno; add defval for raiseErrno,raiseErrnoWithPath (6534a35)
- importDenoOrNodeMod;2-arg importDenoOrProcess. (8f22a68)
- os.utime not work: "fs is not defined". (47eca90)
- fixup(d7541b8): catchJsErrAsCode (used error which is cstring). (694eae8)
Fixes for inconsistence with Python
- Lib/os
- n_tempfile:
- js: mktemp raised OSError over FileNotFoundError. (f576b68)
inner
Feature additions
builtins
Lib
inner
- test: support.os_helper.TESTFN (2c8406a)
- pyconfig: util.from_c_int_expr,
AC_CHECK_FUNC[S]
(6534a35, be5332b) - js:
- jsutils/consts from_js_const (ae1671e)
doc
CI
- testC,testJs: run iff src/,tests/,./.nimble, !feat- branch. (2788f60)
impr
- js: os.{open,close}: use importNode over "require...". (f361005)
refine
refactor
- refact: mv os_impl/private/platform_util root's private (1d5e2a8)
- Lib/unittest: split to unittest/case_py (4853b49)
- Lib/sys: split into sys_impl/; add n_sys (34f0cb9)
- Lib/os_impl: dedup MS_WINDOWS, InJs (6534a35)
Purge warning
v0.9.8: Lib/signal,resource, os.wait*
Full Changelog: v0.9.7...v0.9.8
break
- chore(nimpatch): now when eq
ver
, patch still added
Bug Fixes
- Lib/os not compile:
- getpid
- iter for os.DirEntry
- Lib/string
- Template.substitute(dict): not work
- capwords: with sep had trailing sep
- macos: defined(macosx) shall be always used
- dtoa,pyconfig/floats not compile on arm
x**y
when x is not int not complie
JS
- Lib/os not compile
- getxtime
- os_impl.waits
- getpid: due to
Error: invalid pragma: importDenoOrProcess
- scandir
Fixes for inconsistence with Python
- overwrite Nim's SIGINT handler when not defined pylibUseNimIntHandler
- builtins now contains pyerrors
- str(tuple): now call str on each item
- sugar:
- now rewrite
func(k=v)
's v,(e, ...)
's e
- now rewrite
- sys.hexversion no release and serial; sys.version_info.releaselevel was string over str
- Lib/string Template.substitute:
- now raises as py
- no longer uses std/strutils.
%
- Template is now a ref object
- chore(nimpatch): nansign:
nan
might be negative
inner
- addPatch,platformAvailWhen repr bool expr only shows "true"/"false"
Feature additions
builtins
- round(int, int)
- NameError
- KeyboardInterrupt
Lib
- signal
- resource
- unittest:
- skipTest
- assertFalse
- assert{[Not]{IsInstance,In},IsNot,{Greater,Less}[Equal]}
- assertRaises(TypeError,...) skipIf,skipUnless
- os:
- O_* consts
- wait* func, W* consts
- sys.float_repr_style
- n_string
- string: Template.is_valid,get_identifiers
inner
- Lib/enum_impl: intEnum, enumType
- pyconfig.util from_c_int
- Python/pylifecycle signal
- errno_impl.errnoUtils.setErrnoRaw
- oserr: newErrnoT new raiseErrnoErrT
- refact(os_impl): Py_get_osfhandle_noraise to util/get_osfhandle
doc
- comptime/log1p: add origin impl's url
- format: fix warnings
- mustRewriteExtern: condExpr underscore; fix wrong rewrite of strlitQuote
- readme: update old url, use rel url if possible
CI
- min max
- Lib/string: more for Template
- mv to testaments/:
- titers,titer_next,tlist
- tfloat.nim
- tdict,tset
- round: more for float
impr
- faster int(char)
- numTypes.floats: use faster isfinite from isX
refine
- repr,$: dict,list,set: merge similar code to strIter
Purge warning
- unused:
- due to cond branch
- pyconfig/util.handle_option_bool, jsoserr.jsOs
- tests/tdecorator.nim
- itertools: imported but not used sequtils
v0.9.7: more builtins, libs; support triple py sugar
Full Changelog: v0.9.5...v0.9.7
break
- nitertools ->
n_itertools
; use openArray over seq
Bug Fixes
- sorted not compile for ptr list, etc and for generics seq
- complex(int,int) not compile
- datetime.timedelta not compile
- Lib/errno cannot be compiled in Windows (931a9f5)
except
claude with no exception type (e.g.except:
) crashes compiler- Lib/platform: machine() result fixed for some arch; closes #48
pass expr
was supported instead ofpass
(:usediscard expr
instead)- zip: support no-seq args and any number of args over only 2; allow non-static
strict
- triple strlit won't be escape-translated
except
with no exc type (e.g.except:
) not compile
Fixes for inconsistence with Python
- zip: not compile
Iterable[T]
(T differs each other) - builtins.round(float[, n]) not to-even
- str(Inf) -> Infinity when JS (#44)
- int(char) err msg differs py's
pass expr
was supported instead ofpass
(:usediscard expr
instead)- zip: support no-seq args and any number of args over only 2; allow non-static
strict
- triple strlit won't be escape-translated
except
with no exc type (e.g.except:
) not compile
Feature additions
Lib
- collections.abc: include iters, collections, asyncs, generators
- bisect and
n_bisect
- random (all func besides randint,seed,choice,Random)
- itertools.accumulate
- os.urandom, os.getrandom
- builtins
builtins
- print: allow `end` along with
endl
for keyword - allow items(tuple)
- max/min supports iterable & keywords
- format
- dir
- literal will be automatically interpreted as Py list/set/dict/str
- support
__getitem__
,__setitem__
and__delitem__
syntax (e.g.ls[1:3]
) - strlitCat in def (e.g.
"asds" "sad"
)
in def
(func body)
- support equal sign minus like
x=-1
/x==-1
- literal will be automatically interpreted as Py list/set/dict/str
- support
__getitem__
,__setitem__
and__delitem__
syntax (e.g.ls[1:3]
) - strlitCat in def (e.g.
"asds" "sad"
)
EXT
@
for Sequence- bytes: init from openArray[uint8] or Iterable[SomeInteger]
- nextImpl
inner
- Objects/obmalloc.nim: pyalloc pyfree
- /pyconfig:
- pycore/pymath
c_defined
,py_getrandom
os_impl.platformAvailWhen
- doc(pylib.nim): add version info in doc output
Patches for Nim-compatibility
- newUninit for nim before 2.1.1
CI
- update actions/cache@v2 to v4
- mv tfloat.nim tests tests/testament
- add tests/testament
- doc will be deployed to
docs.nimpylib.org
impr
- faster int(char)
- numTypes.floats: use faster isfinite from isX
- tonim: no list will be initialized when unpacking an array
- print:
sep
,endl
's default value is now char over string
v0.9.5: better math & more libs, generics `def`
Full Changelog: v0.9.3...v0.9.5
Lib
This release fixes some bugs in Lib/math
since last release.
Meanwhile, more libs like inspect
, errno
are added too.
Syntax Added (sugar)
- generics
def
raise ... from ...
statement
v0.9.3: whole math lib equipped
Changelog since latest minor version: changelog_0_9_3.md
(TLNR, really a lot of work...) Full Changelog since 0.6.0: v0.6.0...v0.9.3
This is released with all CPython Lib/math functions implemented,
and as extensions:
- some functions also support float32
- almost all can run under non-C like platforms (JavaScript, NimScript) and even nimvm (compile-time)