Skip to content

Commit

Permalink
fix(packaging): include sutbs in compiled wheel (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
vascoalramos authored Mar 13, 2023
1 parent 8fff584 commit f1e8363
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Temporary Items
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*.py[icod]
*$py.class

# C extensions
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test:
test-cov:
python -m pytest --cov=. src/

clean: clean-build clean-pyc clean-env ### Cleans artifacts
clean: clean-build clean-pyc clean-pyi clean-env ### Cleans artifacts

clean-build: ### Removes builds
find . -type d -iname "build" ! -path "./.venv/*" -exec rm -rf {} +
Expand All @@ -42,6 +42,9 @@ clean-pyc: ### Removes python compiled bytecode files
find . -iname "*.pyc" ! -path "./.venv/*" -delete
find . -type d -iname "__pycache__" ! -path "./.venv/*" -exec rm -rf {} +

clean-pyi: ### Removes python stub files
find . -iname "*.pyi" ! -path "./.venv/*" -delete

install: ### Installs regular dependencies
$(PIP) install .

Expand All @@ -58,15 +61,16 @@ install-all: ### Installs regular, dev, doc, and test dependencies
$(PIP) install ".[dev,doc,test]"

package: ### Builds the package in wheel format
rm -rf build dist
find src/ydata/sdk/ -name "*.pyi" -delete && rm -rf build dist
echo "$(version)" > src/ydata/sdk/VERSION
stubgen src/ydata/sdk -o src --export-less
$(PYTHON) -m build --wheel
twine check dist/*

wheel: ### Compiles the wheel
test -d wheels || mkdir -p wheels
cp dist/ydata_sdk-$(version)-py3-none-any.whl wheels/ydata_sdk-$(version)-py$(PYV)-none-any.whl
$(PYTHON) -m pyc_wheel --exclude="(__init__|dataset).py" wheels/ydata_sdk-$(version)-py$(PYV)-none-any.whl
$(PYTHON) -m pyc_wheel wheels/ydata_sdk-$(version)-py$(PYV)-none-any.whl
twine check wheels/*

publish-docs: ### Publishes the documentation
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dev = [
"isort==5.11.3",
"pre-commit==2.20.0",
"pyc_wheel==1.2.7",
"mypy==1.1.1",
]
doc = [
"mkdocs>=1.4.2,<2.0.0",
Expand All @@ -81,7 +82,10 @@ test = [
version = { attr = "ydata.sdk.__version__" }

[tool.setuptools.package-data]
"*" = ["VERSION"]
"*" = [
"VERSION",
"*.pyi",
]

[tool.setuptools.packages.find]
where = ["src"]
Expand Down
3 changes: 3 additions & 0 deletions src/ydata/sdk/dataset/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .dataset import get_airquality, get_census, get_dataset, get_titanic

__all__ = ["get_dataset", "get_census", "get_airquality", "get_titanic"]
File renamed without changes.

0 comments on commit f1e8363

Please sign in to comment.