Skip to content

Commit

Permalink
switch away from src build
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Feb 1, 2024
1 parent dbb5722 commit e8917fa
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 24 deletions.
2 changes: 1 addition & 1 deletion bindings/python/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
author = "Prashant Mital"
html_show_sphinx = False

version_file = p.abspath(p.join("../../", "src/pymongoarrow/version.py"))
version_file = p.abspath(p.join("../../", "pymongoarrow/version.py"))
version_data = {}
with open(version_file) as vf:
exec(vf.read(), {}, version_data)
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.
3 changes: 0 additions & 3 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ Documentation = "https://mongo-arrow.readthedocs.io"
Source = "https://github.com/mongodb-labs/mongo-arrow/tree/main/bindings/python"
Tracker = "https://jira.mongodb.org/projects/ARROW/issues"

[project.optional-dependencies]
test = ["pytz", "pytest"]

[tool.setuptools]
zip-safe = false
include-package-data = true
Expand Down
6 changes: 3 additions & 3 deletions bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from setuptools import setup

HERE = os.path.abspath(os.path.dirname(__file__))
BUILD_DIR = os.path.join(HERE, "src", "pymongoarrow")
BUILD_DIR = os.path.join(HERE, "pymongoarrow")
IS_WIN = platform == "win32"

# Find and copy the binary libbson file, unless
Expand All @@ -33,7 +33,7 @@ def query_pkgconfig(cmd):
def get_min_libbson_version():
version_ns = {}
here = os.path.dirname(__file__)
version_py = os.path.join(here, "src", "pymongoarrow", "version.py")
version_py = os.path.join(here, "pymongoarrow", "version.py")
with open(version_py) as f:
exec(compile(f.read(), version_py, "exec"), version_ns)
return version_ns["_MIN_LIBBSON_VERSION"]
Expand Down Expand Up @@ -164,7 +164,7 @@ def get_extension_modules():
except ImportError:
warnings.warn("Cannot compile native C code, because of a missing build dependency")
return []
modules = cythonize(["src/pymongoarrow/*.pyx"])
modules = cythonize(["pymongoarrow/*.pyx"])
for module in modules:
append_libbson_flags(module)
append_arrow_flags(module)
Expand Down
26 changes: 9 additions & 17 deletions bindings/python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ envlist =
manifest

[testenv]
skip_install = true
passenv =
LIBBSON_INSTALL_DIR

Expand All @@ -38,10 +39,11 @@ passenv =
LIBBSON_INSTALL_DIR

[testenv:test]
extras =
test
deps =
pytz
pytest
commands =
python --version
python -m pip install -e .
python -m pytest -v {posargs}

[testenv:build-libbson]
Expand Down Expand Up @@ -70,63 +72,53 @@ commands =
python -c "from pymongoarrow.lib import libbson_version"

[testenv:benchmark]
extras =
test
deps =
asv
commands =
python -m pip install -e .
asv run -e --python=`which python` {posargs}

[testenv:docs]
setenv = NO_EXT=1
skip_install = true
changedir = docs
deps =
-rdocs/docs-requirements.txt
commands =
pip install ..
NO_EXT=1 pip install ..
python -m sphinx -q -E -W -b html source {envtmpdir}/html {posargs}

[testenv:docs-serve]
setenv = NO_EXT=1
skip_install = true
description = serve sphinx docs
deps =
{[testenv:docs]deps}
sphinx-autobuild
changedir = docs
commands =
pip install ..
NO_EXT=1 pip install ..
sphinx-autobuild -W -b html source --watch ./pymongoarrow ./_build/serve

[testenv:linkcheck]
skip_install = true
setenv =
PYTHONHASHSEED=0
NO_EXT=1
deps =
{[testenv:docs]deps}
changedir = docs
commands =
pip install ..
NO_EXT=1 pip install ..
python -m sphinx -q -E -b linkcheck source {envtmpdir}/linkcheck {posargs}

[testenv:lint]
skip_install = true
deps =
pre-commit
commands =
python -m pre_commit run --all-files

[testenv:lint-manual]
skip_install = true
deps =
pre-commit
commands =
python -m pre_commit run --all-files --hook-stage=manual

[testenv:manifest]
skip_install = true
deps =
check-manifest
commands =
Expand Down

0 comments on commit e8917fa

Please sign in to comment.