Skip to content

Commit bac0bf9

Browse files
committed
chore: use leading underscore for private objects
1 parent 1746868 commit bac0bf9

File tree

16 files changed

+87
-95
lines changed

16 files changed

+87
-95
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88
- Raise an exception when attempting to decompress empty data
99
- Add `ZstdFile.name` property
1010
- Deprecate `(de)compress_stream` functions
11+
- Use a leading `_` for private objects
1112
- Build wheels for Windows ARM64
1213
- Support for PyPy 3.11
1314

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,20 @@ def do_setup():
166166

167167
if CFFI:
168168
# Packages
169-
packages = ['pyzstd', 'pyzstd.cffi']
169+
packages = ['pyzstd', 'pyzstd._cffi']
170170

171171
# Binary extension
172-
kwargs['module_name'] = 'pyzstd.cffi._cffi_zstd'
172+
kwargs['module_name'] = 'pyzstd._cffi._cffi_zstd'
173173

174174
sys.path.append('build_script')
175175
import pyzstd_build_cffi
176176
binary_extension = pyzstd_build_cffi.get_extension(**kwargs)
177177
else: # C implementation
178178
# Packages
179-
packages = ['pyzstd', 'pyzstd.c']
179+
packages = ['pyzstd', 'pyzstd._c']
180180

181181
# Binary extension
182-
kwargs['name'] = 'pyzstd.c._zstd'
182+
kwargs['name'] = 'pyzstd._c._zstd'
183183
kwargs['sources'].append('src/bin_ext/pyzstd.c')
184184
if MULTI_PHASE_INIT:
185185
# Use multi-phase initialization (PEP-489) on CPython 3.11.

src/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
try:
22
# Import C implementation
3-
from .c import (
3+
from ._c import (
44
CParameter,
55
DParameter,
66
EndlessZstdDecompressor,
@@ -11,8 +11,8 @@
1111
ZstdDecompressor,
1212
ZstdDict,
1313
ZstdError,
14-
ZstdFileReader,
15-
ZstdFileWriter,
14+
ZstdFileReader as _ZstdFileReader,
15+
ZstdFileWriter as _ZstdFileWriter,
1616
_ZSTD_CStreamSizes,
1717
_ZSTD_DStreamSizes,
1818
_finalize_dict,
@@ -29,7 +29,7 @@
2929
except ImportError:
3030
try:
3131
# Import CFFI implementation
32-
from .cffi import (
32+
from ._cffi import (
3333
CParameter,
3434
DParameter,
3535
EndlessZstdDecompressor,
@@ -40,8 +40,8 @@
4040
ZstdDecompressor,
4141
ZstdDict,
4242
ZstdError,
43-
ZstdFileReader,
44-
ZstdFileWriter,
43+
ZstdFileReader as _ZstdFileReader,
44+
ZstdFileWriter as _ZstdFileWriter,
4545
_ZSTD_CStreamSizes,
4646
_ZSTD_DStreamSizes,
4747
_finalize_dict,
@@ -64,8 +64,8 @@
6464
" that has libzstd.dll should be added by os.add_dll_directory() function.\n"
6565
"2, Please install pyzstd module through pip, to ensure that compiled\n"
6666
" .so/.pyd file matches the architecture/OS/Python.\n")
67-
from .zstdfile import ZstdFile, open
68-
from .seekable_zstdfile import SeekableFormatError, SeekableZstdFile
67+
from ._zstdfile import ZstdFile, open
68+
from ._seekable_zstdfile import SeekableFormatError, SeekableZstdFile
6969

7070
from functools import wraps
7171

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)