From 7a6ca6eb2b109f81f0d18ba4b7526d71e80467c9 Mon Sep 17 00:00:00 2001 From: Shaheed Haque Date: Thu, 7 Mar 2024 18:04:01 +0000 Subject: [PATCH 01/13] Correctly handle filenames that contain "." prior to the extension. Resolves #115. --- pyexcel_io/writers/csv_sheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyexcel_io/writers/csv_sheet.py b/pyexcel_io/writers/csv_sheet.py index 422dbed..d2a2db0 100644 --- a/pyexcel_io/writers/csv_sheet.py +++ b/pyexcel_io/writers/csv_sheet.py @@ -47,7 +47,7 @@ def __init__( def get_writer(self): if self._sheet_name != constants.DEFAULT_SHEET_NAME: - names = self._native_book.split(".") + names = self._native_book.rsplit(".", 1) file_name = "%s%s%s%s%s.%s" % ( names[0], constants.DEFAULT_MULTI_CSV_SEPARATOR, From 4891cc981254de752ae7862e04f45db562b72dcd Mon Sep 17 00:00:00 2001 From: Shaheed Haque Date: Sat, 9 Mar 2024 10:14:27 +0000 Subject: [PATCH 02/13] Update CHANGELOG.rst. --- CHANGELOG.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5cd5f17..d0d4d8a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ Change log ================================================================================ +0.6.7 - unreleased +-------------------------------------------------------------------------------- + +#. `#115 `_: Pathnames with + "." cause file_name error in get_writer. + 0.6.6 - 31.1.2022 -------------------------------------------------------------------------------- From 1bd673a9dbfd758a9eea8977023889c246f83849 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 13:55:21 +0000 Subject: [PATCH 03/13] add chardet as dependency, related to https://github.com/pyexcel/pyexcel/issues/272 --- .github/workflows/moban-update.yml | 1 + .github/workflows/pythonpublish.yml | 19 ++++++++++++------- .github/workflows/tests.yml | 24 ++++++++++++------------ pyexcel-io.yml | 1 + requirements.txt | 1 + setup.py | 4 +++- 6 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/moban-update.yml b/.github/workflows/moban-update.yml index 73a3aed..4038e3d 100644 --- a/.github/workflows/moban-update.yml +++ b/.github/workflows/moban-update.yml @@ -15,6 +15,7 @@ jobs: python-version: '3.7' - name: check changes run: | + pip install markupsafe==2.0.1 pip install moban gitfs2 pypifs moban-jinja2-github moban-ansible moban git status diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 9e7ec42..4ccaa8d 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -5,9 +5,16 @@ on: types: [created] jobs: - deploy: + pypi-publish: + name: upload release to PyPI runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: pypi + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write steps: + # retrieve your distributions here - uses: actions/checkout@v1 - name: Set up Python uses: actions/setup-python@v1 @@ -16,11 +23,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + pip install setuptools wheel + - name: Build run: | python setup.py sdist bdist_wheel - twine upload dist/* + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 801d2cd..8e2f2b3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,26 +1,26 @@ -name: Run unit tests on Windows and Mac +name: Run unit tests on Windows, Ubuntu and Mac on: [push, pull_request] jobs: + test: + name: ${{ matrix.os }} / ${{ matrix.python_version }} + runs-on: ${{ matrix.os }}-latest strategy: - fail-fast: false - matrix: - python-version: [3.6, 3.7, 3.8, 3.9] - os: [macOs-latest, ubuntu-latest, windows-latest] - exclude: - - os: macOs-latest - python-version: 3.6 + fail-fast: false + matrix: + os: [Ubuntu] + python_version: ["3.9.16"] - runs-on: ${{ matrix.os }} - name: run tests steps: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python_version }} + architecture: x64 + - name: install run: | pip --use-deprecated=legacy-resolver install -r requirements.txt diff --git a/pyexcel-io.yml b/pyexcel-io.yml index 7dad5e1..339c1c9 100644 --- a/pyexcel-io.yml +++ b/pyexcel-io.yml @@ -9,6 +9,7 @@ copyright_year: 2015-2022 moban_command: false is_on_conda: true dependencies: + - chardet - lml>=0.0.4 test_dependencies: - pyexcel diff --git a/requirements.txt b/requirements.txt index 8539e81..6b8c762 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ +chardet lml>=0.0.4 diff --git a/setup.py b/setup.py index 90e27da..65de74b 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ ) URL = "https://github.com/pyexcel/pyexcel-io" DOWNLOAD_URL = "%s/archive/0.6.6.tar.gz" % URL -FILES = ["README.rst", "CHANGELOG.rst"] +FILES = ["README.rst", "CONTRIBUTORS.rst", "CHANGELOG.rst"] KEYWORDS = [ "python", "API", @@ -68,11 +68,13 @@ 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: Implementation :: PyPy' + ] PYTHON_REQUIRES = ">=3.6" INSTALL_REQUIRES = [ + "chardet", "lml>=0.0.4", ] SETUP_COMMANDS = {} From 68d362dd77c170bc4a199d64316ac3624c676256 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 13:57:52 +0000 Subject: [PATCH 04/13] This is an auto-commit, updating project meta data, such as changelog.rst, contributors.rst --- CHANGELOG.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d0d4d8a..5cd5f17 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,12 +1,6 @@ Change log ================================================================================ -0.6.7 - unreleased --------------------------------------------------------------------------------- - -#. `#115 `_: Pathnames with - "." cause file_name error in get_writer. - 0.6.6 - 31.1.2022 -------------------------------------------------------------------------------- From cd4ef21ab2b2f8c1f26305ff90b7138988e3fb6c Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 14:02:02 +0000 Subject: [PATCH 05/13] update change log --- changelog.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.yml b/changelog.yml index e9244a9..a1f58ec 100644 --- a/changelog.yml +++ b/changelog.yml @@ -1,6 +1,12 @@ name: pyexcel-io organisation: pyexcel releases: +- changes: + - action: updated + details: + - "`#115`: Pathnames with . cause file_name error in get_writer." + version: 0.6.7 + date: 09.11.2024 - changes: - action: updated details: From 5890b72ab1658f04d6db21c4bd700618107f9f68 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 14:02:25 +0000 Subject: [PATCH 06/13] This is an auto-commit, updating project meta data, such as changelog.rst, contributors.rst --- CHANGELOG.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5cd5f17..f1d9c21 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,14 @@ Change log ================================================================================ +0.6.7 - 09.11.2024 +-------------------------------------------------------------------------------- + +**updated** + +#. `#115 `_: Pathnames with . + cause file_name error in get_writer. + 0.6.6 - 31.1.2022 -------------------------------------------------------------------------------- From 041cfd8df516fd1c513bec8d6c59322974201135 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 14:05:01 +0000 Subject: [PATCH 07/13] move chardet to optional lib --- pyexcel-io.yml | 2 +- pyexcel_io/readers/csvz.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyexcel-io.yml b/pyexcel-io.yml index 339c1c9..626155e 100644 --- a/pyexcel-io.yml +++ b/pyexcel-io.yml @@ -9,7 +9,6 @@ copyright_year: 2015-2022 moban_command: false is_on_conda: true dependencies: - - chardet - lml>=0.0.4 test_dependencies: - pyexcel @@ -17,6 +16,7 @@ test_dependencies: - SQLAlchemy - pyexcel-xlsxw extra_dependencies: + - chardet - xls: - pyexcel-xls>=0.6.0 - xlsx: diff --git a/pyexcel_io/readers/csvz.py b/pyexcel_io/readers/csvz.py index cae0383..36af596 100644 --- a/pyexcel_io/readers/csvz.py +++ b/pyexcel_io/readers/csvz.py @@ -10,7 +10,11 @@ import zipfile from io import BytesIO -import chardet +try: + import chardet +except ImportError: + print("Please install chardet so as to use csvz") + raise from pyexcel_io import constants from pyexcel_io.sheet import NamedContent from pyexcel_io._compact import StringIO From 0b5827d38f6ee313bb323b16bdec60408528f424 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 14:08:17 +0000 Subject: [PATCH 08/13] update files --- pyexcel-io.yml | 4 +++- requirements.txt | 1 - setup.py | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyexcel-io.yml b/pyexcel-io.yml index 626155e..fecf230 100644 --- a/pyexcel-io.yml +++ b/pyexcel-io.yml @@ -15,8 +15,10 @@ test_dependencies: - pyexcel-xls==0.5.9 - SQLAlchemy - pyexcel-xlsxw -extra_dependencies: - chardet +extra_dependencies: + - extra: + - chardet - xls: - pyexcel-xls>=0.6.0 - xlsx: diff --git a/requirements.txt b/requirements.txt index 6b8c762..8539e81 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -chardet lml>=0.0.4 diff --git a/setup.py b/setup.py index 65de74b..f226e27 100644 --- a/setup.py +++ b/setup.py @@ -74,7 +74,6 @@ PYTHON_REQUIRES = ">=3.6" INSTALL_REQUIRES = [ - "chardet", "lml>=0.0.4", ] SETUP_COMMANDS = {} From 54851f57ff6e95e60d21d175f2cc58f788c35116 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 14:08:45 +0000 Subject: [PATCH 09/13] This is an auto-commit, updating project meta data, such as changelog.rst, contributors.rst --- setup.py | 1 + tests/requirements.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/setup.py b/setup.py index f226e27..f444c91 100644 --- a/setup.py +++ b/setup.py @@ -80,6 +80,7 @@ PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests", "tests.*"]) EXTRAS_REQUIRE = { + "extra": ['chardet'], "xls": ['pyexcel-xls>=0.6.0'], "xlsx": ['pyexcel-xlsx>=0.6.0'], "ods": ['pyexcel-ods3>=0.6.0'], diff --git a/tests/requirements.txt b/tests/requirements.txt index be90c0a..29d4c98 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -13,3 +13,4 @@ pyexcel pyexcel-xls==0.5.9 SQLAlchemy pyexcel-xlsxw +chardet From 27ca0d1f6163443f0c25cf76092b847c8a967803 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 14:11:22 +0000 Subject: [PATCH 10/13] :fire: remove old unit test workflow --- .github/workflows/pythonpackage.yml | 30 ----------------------------- 1 file changed, 30 deletions(-) delete mode 100644 .github/workflows/pythonpackage.yml diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml deleted file mode 100644 index e19f742..0000000 --- a/.github/workflows/pythonpackage.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Unit tests on ubuntu - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - python-version: [3.6, 3.7, 3.8] - - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - name: Lint with flake8 - run: | - make install_test format git-diff-check lint - - name: Test - run: | - pip install -r tests/requirements.txt - make From 41e238f3794a01a75456ab35e4def116c2c16a95 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 14:20:21 +0000 Subject: [PATCH 11/13] :doc: update a type in doc. related to #117 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 8bb697c..2fd4b1c 100644 --- a/LICENSE +++ b/LICENSE @@ -13,7 +13,7 @@ that the following conditions are met: and/or other materials provided with the distribution. * Neither the name of 'pyexcel-io' nor the names of the contributors - may not be used to endorse or promote products derived from this software + may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND From e1dacf2840941ee967b4c32784317711e22dbba7 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 14:21:22 +0000 Subject: [PATCH 12/13] :doc: update change log --- changelog.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.yml b/changelog.yml index a1f58ec..7fa2641 100644 --- a/changelog.yml +++ b/changelog.yml @@ -5,6 +5,7 @@ releases: - action: updated details: - "`#115`: Pathnames with . cause file_name error in get_writer." + - "`#117`: fix a typo in license." version: 0.6.7 date: 09.11.2024 - changes: From 2627ee0ceb1ae24c53350f4eeaed37bd17cd4b37 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 9 Nov 2024 14:23:43 +0000 Subject: [PATCH 13/13] This is an auto-commit, updating project meta data, such as changelog.rst, contributors.rst --- CHANGELOG.rst | 2 ++ README.rst | 2 +- docs/source/index.rst | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f1d9c21..2fabd22 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,8 @@ Change log #. `#115 `_: Pathnames with . cause file_name error in get_writer. +#. `#117 `_: fix a typo in + license. 0.6.6 - 31.1.2022 -------------------------------------------------------------------------------- diff --git a/README.rst b/README.rst index c4f43b7..2644c4f 100644 --- a/README.rst +++ b/README.rst @@ -79,7 +79,7 @@ sqlalchemy supported databases. Its supported file formats are extended to cover ======================== ======================= ================= Package name Supported file formats Dependencies ======================== ======================= ================= - `pyexcel-io`_ csv, csvz [#f1]_, tsv, + `pyexcel-io`_ csv, csvz [#f1]_, tsv, csvz,tsvz readers depends on `chardet` tsvz [#f2]_ `pyexcel-xls`_ xls, xlsx(read only), `xlrd`_, xlsm(read only) `xlwt`_ diff --git a/docs/source/index.rst b/docs/source/index.rst index baf6fd9..5bac56f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -67,7 +67,7 @@ For individual excel file formats, please install them as you wish: ======================== ======================= ================= Package name Supported file formats Dependencies ======================== ======================= ================= - `pyexcel-io`_ csv, csvz [#f1]_, tsv, + `pyexcel-io`_ csv, csvz [#f1]_, tsv, csvz,tsvz readers depends on `chardet` tsvz [#f2]_ `pyexcel-xls`_ xls, xlsx(read only), `xlrd`_, xlsm(read only) `xlwt`_