From 46a2e341478f1cf0abf2673fec3b3d1399574c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Wed, 9 Nov 2022 10:45:19 +0600 Subject: [PATCH 1/5] fixed #2, updated project's structure with maturin docs --- Cargo.toml | 1 + pyproject.toml | 3 ++- python/__init__.py | 1 - python/python_calamine/__init__.py | 1 + .../_python_calamine.pyi} | 0 python/{ => python_calamine}/pandas.py | 2 +- python/python_calamine/py.typed | 0 src/lib.rs | 2 +- 8 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 python/__init__.py create mode 100644 python/python_calamine/__init__.py rename python/{python_calamine.pyi => python_calamine/_python_calamine.pyi} (100%) rename python/{ => python_calamine}/pandas.py (97%) create mode 100644 python/python_calamine/py.typed diff --git a/Cargo.toml b/Cargo.toml index e3e87fc..c79bdab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,4 @@ pyo3-build-config = "0.17.2" [package.metadata.maturin] python-source = "python" +name = "python_calamine._python_calamine" diff --git a/pyproject.toml b/pyproject.toml index bb3bdc6..9a372fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,10 +9,11 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ] [build-system] -requires = ["maturin>=0.11,<0.12"] +requires = ["maturin>=0.13,<0.14"] build-backend = "maturin" [tool.poetry] diff --git a/python/__init__.py b/python/__init__.py deleted file mode 100644 index d25c2dc..0000000 --- a/python/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .python_calamine import get_sheet_data, get_sheet_names # noqa: F401 diff --git a/python/python_calamine/__init__.py b/python/python_calamine/__init__.py new file mode 100644 index 0000000..901166e --- /dev/null +++ b/python/python_calamine/__init__.py @@ -0,0 +1 @@ +from ._python_calamine import get_sheet_data, get_sheet_names # noqa: F401 diff --git a/python/python_calamine.pyi b/python/python_calamine/_python_calamine.pyi similarity index 100% rename from python/python_calamine.pyi rename to python/python_calamine/_python_calamine.pyi diff --git a/python/pandas.py b/python/python_calamine/pandas.py similarity index 97% rename from python/pandas.py rename to python/python_calamine/pandas.py index f1d8699..ee18bcd 100644 --- a/python/pandas.py +++ b/python/python_calamine/pandas.py @@ -8,7 +8,7 @@ from pandas.io.excel import ExcelFile from pandas.io.excel._base import BaseExcelReader, inspect_excel_format -from .python_calamine import get_sheet_data, get_sheet_names +from ._python_calamine import get_sheet_data, get_sheet_names class __calamine__: diff --git a/python/python_calamine/py.typed b/python/python_calamine/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/src/lib.rs b/src/lib.rs index f5885c0..8a7dd95 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,7 +82,7 @@ fn get_sheet_names(path: &str) -> PyResult> { } #[pymodule] -fn python_calamine(py: Python, m: &PyModule) -> PyResult<()> { +fn _python_calamine(py: Python, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(get_sheet_data, m)?)?; m.add_function(wrap_pyfunction!(get_sheet_names, m)?)?; m.add("CalamineError", py.get_type::())?; From e93cae8562e9b5e866303ac9239a1c6221c3a212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Wed, 9 Nov 2022 10:47:23 +0600 Subject: [PATCH 2/5] added python 3.11 on macos, revert cd643abbccbf62a02c3a222bbeab22e1196e2ce6 --- .github/workflows/Build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index c8d6b05..92e96f6 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -7,7 +7,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 From 7a33f24565635ce05d10dd8d49cae8b01c00bf65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Wed, 9 Nov 2022 10:49:29 +0600 Subject: [PATCH 3/5] updated rust/python dependencies with better support python 3.11 --- Cargo.toml | 2 +- poetry.lock | 45 ++++++++++++++++++++++----------------------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c79bdab..2e4b61b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ crate-type = ["cdylib"] [dependencies] calamine = {version = "0.19.1", features = ["dates", "chrono"] } -pyo3 = {version = "0.17.2", features = ["extension-module", "chrono"] } +pyo3 = {version = "0.17.3", features = ["extension-module", "chrono"] } chrono = { version = "0.4.22", features = ["serde"] } [build-dependencies] diff --git a/poetry.lock b/poetry.lock index da6c54d..8de5381 100644 --- a/poetry.lock +++ b/poetry.lock @@ -57,7 +57,7 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7 [[package]] name = "exceptiongroup" -version = "1.0.0rc9" +version = "1.0.1" description = "Backport of PEP 654 (exception groups)" category = "dev" optional = false @@ -121,7 +121,7 @@ requirements-deprecated-finder = ["pip-api", "pipreqs"] [[package]] name = "maturin" -version = "0.13.6" +version = "0.13.7" description = "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages" category = "dev" optional = false @@ -171,15 +171,15 @@ python-versions = ">=3.7" [[package]] name = "platformdirs" -version = "2.5.2" -description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +version = "2.5.3" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false python-versions = ">=3.7" [package.extras] -docs = ["furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx (>=4)", "sphinx-autodoc-typehints (>=1.12)"] -test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"] +docs = ["furo (>=2022.9.29)", "proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.4)"] +test = ["appdirs (==1.4.4)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] [[package]] name = "pluggy" @@ -322,8 +322,8 @@ colorama = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] exceptiongroup = [ - {file = "exceptiongroup-1.0.0rc9-py3-none-any.whl", hash = "sha256:2e3c3fc1538a094aab74fad52d6c33fc94de3dfee3ee01f187c0e0c72aec5337"}, - {file = "exceptiongroup-1.0.0rc9.tar.gz", hash = "sha256:9086a4a21ef9b31c72181c77c040a074ba0889ee56a7b289ff0afb0d97655f96"}, + {file = "exceptiongroup-1.0.1-py3-none-any.whl", hash = "sha256:4d6c0aa6dd825810941c792f53d7b8d71da26f5e5f84f20f9508e8f2d33b140a"}, + {file = "exceptiongroup-1.0.1.tar.gz", hash = "sha256:73866f7f842ede6cb1daa42c4af078e2035e5f7607f0e2c762cc51bb31bbe7b2"}, ] flake8 = [ {file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"}, @@ -342,19 +342,18 @@ isort = [ {file = "isort-5.10.1.tar.gz", hash = "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"}, ] maturin = [ - {file = "maturin-0.13.6-py3-none-linux_armv6l.whl", hash = "sha256:860badb4c7a13e5e6d5df258c409c2b4b23591af293fe47a5d85bf112ffce16d"}, - {file = "maturin-0.13.6-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:b4da3c045d29f04dd4d11978d6b16b46daaacd16d1ad59e02008198837537cc8"}, - {file = "maturin-0.13.6-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:2ab4d3ee49f5926a0cf26a319609e03eb37eb00f338e544ad6445ecb1971f2ef"}, - {file = "maturin-0.13.6-py3-none-manylinux_2_12_i686.manylinux2010_i686.musllinux_1_1_i686.whl", hash = "sha256:ca1e1b7b2c1e9a5d8e0ad11f63d5181159ca52f1e14a8ee8472bf65e7f56d4fa"}, - {file = "maturin-0.13.6-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl", hash = "sha256:44add21ea04aa3abef41e840113a85d83ab28c354025c150b1f0a943b8d4a884"}, - {file = "maturin-0.13.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:ef01b71d57f01aef29ec804ea0e895e9f966b34bf24e874a71a1c270f42d7492"}, - {file = "maturin-0.13.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:3cd53bb17f6d81e1d19fde5b65722f1a1fcda7b63cd9c99873252c7e3b9659f1"}, - {file = "maturin-0.13.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.musllinux_1_1_ppc64le.whl", hash = "sha256:3d8f24d7698944e4effab479967dc2f73aeb427aa5e8542abeba0bf4812d3168"}, - {file = "maturin-0.13.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:10b5563a047bed00b3ac791030205dc4b916193795da0143b52050046ae2fd31"}, - {file = "maturin-0.13.6-py3-none-win32.whl", hash = "sha256:3db7663f4a1b81370ec1c6494b4701220b7c64ed50c28d9c37ce171d73a127c1"}, - {file = "maturin-0.13.6-py3-none-win_amd64.whl", hash = "sha256:de35b0e88c5f8ecbbbc4c44bbdf0bbfd6668b24631627725f86fa3323e112d14"}, - {file = "maturin-0.13.6-py3-none-win_arm64.whl", hash = "sha256:0735621caafc0c65d809e1d381afdea82fb0c44b08a2619ec96cccf7e37d5c3b"}, - {file = "maturin-0.13.6.tar.gz", hash = "sha256:df649c77dc9da2182322764fdaa265ef4e2fd74c87d9022e3463e130e5d2c536"}, + {file = "maturin-0.13.7-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:bc58b0266a4c124f9afd69a987ac324ff35c0d963b41073ed64a32f94c226d5a"}, + {file = "maturin-0.13.7-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:424d53adc9684167cf89829275fe5072331a197de0ac08e7a893f9283c7df213"}, + {file = "maturin-0.13.7-py3-none-manylinux_2_12_i686.manylinux2010_i686.musllinux_1_1_i686.whl", hash = "sha256:3137876c338eb7e551ba44a609b5f02d02454d1b3a8677ad6bf2121c5a92b2b7"}, + {file = "maturin-0.13.7-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl", hash = "sha256:a96f1b3ede71c0f76b8c7cfac18a9eec90174bdf434fa9aeff491be9a7ca5179"}, + {file = "maturin-0.13.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:0b6ac1219a809155057fd1f358f7ece03c3abd2e2991832ce5146825a9fa4160"}, + {file = "maturin-0.13.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:3c36f429adc3a8af8de9838399750742a86053f0031a953b48ee92932120dc0c"}, + {file = "maturin-0.13.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.musllinux_1_1_ppc64le.whl", hash = "sha256:bb3a2830d64ae6a324571f694475b91111e827bc0ccc60a0c47f4fb596a46bd8"}, + {file = "maturin-0.13.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:794f58d3103449f8cd8ab5f36fd05c31b8d8de3643cd0e3720fd5dc3c328dd5c"}, + {file = "maturin-0.13.7-py3-none-win32.whl", hash = "sha256:63586eb286866264ec62d29df6ab955360de6226128f67d14623ffe1a12d4963"}, + {file = "maturin-0.13.7-py3-none-win_amd64.whl", hash = "sha256:f50d62aca567fdbbb929771794f3c5c78048ef0efa4af7d83ed472a8b8d26454"}, + {file = "maturin-0.13.7-py3-none-win_arm64.whl", hash = "sha256:8c6225e7eba2885a0cd82a6cf898e74bb720796a5744e0450f3b1340d1ca97af"}, + {file = "maturin-0.13.7.tar.gz", hash = "sha256:c0a77aa0c57f945649ca711c806203a1b6888ad49c2b8b85196ffdcf0421db77"}, ] mccabe = [ {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, @@ -373,8 +372,8 @@ pathspec = [ {file = "pathspec-0.10.1.tar.gz", hash = "sha256:7ace6161b621d31e7902eb6b5ae148d12cfd23f4a249b9ffb6b9fee12084323d"}, ] platformdirs = [ - {file = "platformdirs-2.5.2-py3-none-any.whl", hash = "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788"}, - {file = "platformdirs-2.5.2.tar.gz", hash = "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"}, + {file = "platformdirs-2.5.3-py3-none-any.whl", hash = "sha256:0cb405749187a194f444c25c82ef7225232f11564721eabffc6ec70df83b11cb"}, + {file = "platformdirs-2.5.3.tar.gz", hash = "sha256:6e52c21afff35cb659c6e52d8b4d61b9bd544557180440538f255d9382c8cbe0"}, ] pluggy = [ {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, From f9414869f3b8563e5ce0694851ef1c0ff7098144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Wed, 9 Nov 2022 11:10:50 +0600 Subject: [PATCH 4/5] fixed build option, see PyO3/maturin#955 --- .github/workflows/Build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 92e96f6..483fd60 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -26,7 +26,7 @@ jobs: uses: messense/maturin-action@v1 with: target: x86_64 - args: -i python --release --out dist + args: -i python --release --out dist --sdist - name: Install built wheel - x86_64 run: | pip install python-calamine --no-index --find-links dist --force-reinstall @@ -34,7 +34,7 @@ jobs: if: ${{ matrix.python-version != '3.7' }} uses: messense/maturin-action@v1 with: - args: -i python --release --universal2 --out dist --no-sdist + args: -i python --release --universal2 --out dist - name: Install built wheel - universal2 if: ${{ matrix.python-version != '3.7' }} run: | @@ -76,7 +76,7 @@ jobs: uses: messense/maturin-action@v1 with: target: ${{ matrix.target }} - args: -i python --release --out dist --no-sdist + args: -i python --release --out dist - name: Install built wheel run: | pip install python-calamine --no-index --find-links dist --force-reinstall @@ -114,7 +114,7 @@ jobs: with: target: ${{ matrix.target }} manylinux: auto - args: -i python${{ matrix.python-version }} --release --out dist --no-sdist + args: -i python${{ matrix.python-version }} --release --out dist - name: Python UnitTest if: matrix.target == 'x86_64' run: | From 1472c24b519931c3ce77c1ff9bfd18500edbfb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Wed, 9 Nov 2022 11:23:21 +0600 Subject: [PATCH 5/5] bump version to 0.0.5 --- Cargo.toml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2e4b61b..6679b2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "python-calamine" -version = "0.0.4" +version = "0.0.5" authors = ["Dmitriy "] description = "Python binding for Rust's library for reading excel and odf file - calamine" edition = "2018" diff --git a/pyproject.toml b/pyproject.toml index 9a372fe..244235d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ build-backend = "maturin" [tool.poetry] name = "python-calamine" -version = "0.0.4" +version = "0.0.5" description = "" authors = ["Dmitriy "]