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/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 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/CHANGELOG.rst b/CHANGELOG.rst index 5cd5f17..2fabd22 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,16 @@ Change log ================================================================================ +0.6.7 - 09.11.2024 +-------------------------------------------------------------------------------- + +**updated** + +#. `#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/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 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/changelog.yml b/changelog.yml index e9244a9..7fa2641 100644 --- a/changelog.yml +++ b/changelog.yml @@ -1,6 +1,13 @@ name: pyexcel-io organisation: pyexcel releases: +- changes: + - 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: - action: updated details: 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`_ diff --git a/pyexcel-io.yml b/pyexcel-io.yml index 7dad5e1..fecf230 100644 --- a/pyexcel-io.yml +++ b/pyexcel-io.yml @@ -15,7 +15,10 @@ test_dependencies: - pyexcel-xls==0.5.9 - SQLAlchemy - pyexcel-xlsxw + - chardet extra_dependencies: + - extra: + - 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 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, diff --git a/setup.py b/setup.py index 90e27da..f444c91 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,6 +68,7 @@ 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: Implementation :: PyPy' + ] PYTHON_REQUIRES = ">=3.6" @@ -79,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