Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTHON-4163 Rename src/ to bsonjs/ to avoid setuptools bug that shadows bson package #53

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include README.rst
include CHANGELOG.rst
include LICENSE
recursive-include src LICENSE
recursive-include src *.h
recursive-include test *.py
recursive-include bsonjs LICENSE
recursive-include bsonjs *.h
recursive-include bsonjs *.py
exclude benchmark.py
exclude build-wheels.sh
exclude docker-build.sh
Expand Down
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.
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.
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.
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.
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.
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.
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.
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.
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.
File renamed without changes.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
requires = ["setuptools>=62.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["bsonjs"]

[project]
name = "python-bsonjs"
version = "0.3.0"
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
ext_modules=[
Extension(
"bsonjs",
sources=["src/bsonjs.c"] + glob.glob("src/*/*.c"),
include_dirs=["src",
"src/bson",
"src/jsonsl",
"src/common"],
sources=["bsonjs/bsonjs.c"] + glob.glob("bsonjs/*/*.c"),
include_dirs=["bsonjs",
"bsonjs/bson",
"bsonjs/jsonsl",
"bsonjs/common"],
py_limited_api=True,
define_macros=[("BSON_COMPILATION", 1),
("Py_LIMITED_API", "0x03060000")],
Expand Down
22 changes: 11 additions & 11 deletions vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ python build/calc_release_version.py > VERSION_CURRENT
mkdir cmake-build && cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_MONGOC=OFF ..
cd ../../
rm -r python-bsonjs/src/bson
rm -r python-bsonjs/src/jsonsl
rm -r python-bsonjs/src/common
rsync -r mongo-c-driver/src/libbson/src/bson/*.[hc] python-bsonjs/src/bson/
rsync -r mongo-c-driver/src/libbson/src/jsonsl/*.[hc] python-bsonjs/src/jsonsl/
rsync -r mongo-c-driver/src/libbson/src/jsonsl/LICENSE python-bsonjs/src/jsonsl/
rm -r python-bsonjs/bsonjs/bson
rm -r python-bsonjs/bsonjs/jsonsl
rm -r python-bsonjs/bsonjs/common
rsync -r mongo-c-driver/src/libbson/src/bson/*.[hc] python-bsonjs/bsonjs/bson/
rsync -r mongo-c-driver/src/libbson/src/jsonsl/*.[hc] python-bsonjs/bsonjs/jsonsl/
rsync -r mongo-c-driver/src/libbson/src/jsonsl/LICENSE python-bsonjs/bsonjs/jsonsl/

rsync -r mongo-c-driver/src/common/*.[hc] python-bsonjs/src/common/
rsync -r mongo-c-driver/cmake-build/src/common/*.[hc] python-bsonjs/src/common/
rsync -r mongo-c-driver/src/common/*.[hc] python-bsonjs/bsonjs/common/
rsync -r mongo-c-driver/cmake-build/src/common/*.[hc] python-bsonjs/bsonjs/common/

rsync -r mongo-c-driver/cmake-build/src/libbson/src/bson/*.[hc] python-bsonjs/src/bson/
rsync -r mongo-c-driver/cmake-build/src/libbson/src/bson/*.[hc] python-bsonjs/bsonjs/bson/

# Ignore autogenerated bson-config.h
cd python-bsonjs/
git diff -- src/bson/bson-config.h | tee
git diff -- bsonjs/bson/bson-config.h | tee
echo "**** Review libbson's autogenerated src/bson/bson-config.h (above) for newly added (or removed) macros ****"
git checkout -- src/bson/bson-config.h
git checkout -- bsonjs/bson/bson-config.h
Loading