From bfb68d79c3a846c54b50de9b4621ce651c20f6ec Mon Sep 17 00:00:00 2001 From: chfw Date: Sun, 10 Nov 2024 17:21:46 +0000 Subject: [PATCH] :books: update build chain and docs --- .github/workflows/lint.yml | 4 ++-- .github/workflows/moban-update.yml | 8 ++++---- .github/workflows/pythonpublish.yml | 19 ++++++++++++------- .github/workflows/tests.yml | 25 ++++++++++++++----------- .gitignore | 2 +- CHANGELOG.rst | 7 +++++++ CONTRIBUTORS.rst | 3 ++- LICENSE | 4 ++-- README.rst | 22 +++++++++------------- changelog.yml | 2 ++ docs/source/conf.py | 11 ++++++----- pyexcel-xlsx.yml | 6 +++--- setup.py | 8 ++++---- 13 files changed, 68 insertions(+), 53 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 03122a1..3789494 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: python-version: 3.8 - name: lint run: | - pip install flake8 - pip install -r tests/requirements.txt + pip --use-deprecated=legacy-resolver install flake8 + pip --use-deprecated=legacy-resolver install -r tests/requirements.txt flake8 --exclude=.moban.d,docs,setup.py --builtins=unicode,xrange,long . python setup.py checkdocs diff --git a/.github/workflows/moban-update.yml b/.github/workflows/moban-update.yml index 706fd82..4038e3d 100644 --- a/.github/workflows/moban-update.yml +++ b/.github/workflows/moban-update.yml @@ -8,22 +8,22 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} + token: ${{ secrets.PAT }} - name: Set up Python uses: actions/setup-python@v1 with: 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 git diff --exit-code - name: Auto-commit if: failure() - uses: docker://cdssnc/auto-commit-github-action - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: stefanzweifel/git-auto-commit-action@v4 with: - args: >- + commit_message: >- This is an auto-commit, updating project meta data, such as changelog.rst, contributors.rst 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 c9705d1..3fc8671 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,27 +1,30 @@ -name: run_tests +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] + 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 install -r requirements.txt - pip install -r tests/requirements.txt + pip --use-deprecated=legacy-resolver install -r requirements.txt + pip --use-deprecated=legacy-resolver install -r tests/requirements.txt - name: test run: | pip freeze diff --git a/.gitignore b/.gitignore index a6d7623..e8b12f9 100644 --- a/.gitignore +++ b/.gitignore @@ -90,7 +90,7 @@ ipython_config.py # pyenv # For a library or package, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: -.python-version +# .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fa56192..bc47779 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,13 @@ Change log ================================================================================ +0.6.1 - 10.11.2024 +-------------------------------------------------------------------------------- + +**Updated** + +#. Compatability with openpyxl 3.1.0 and later + 0.6.0 - 10.10.2020 -------------------------------------------------------------------------------- diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index fae3a43..f1d8c27 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -1,11 +1,12 @@ -4 contributors +5 contributors ================================================================================ In alphabetical order: * `Benoit Pierre `_ +* `Chun-Sheng, Li `_ * `Craig Anderson `_ * `John Vandenberg `_ * `Stephen J. Fuhry `_ diff --git a/LICENSE b/LICENSE index 8238af6..ba61862 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2020 by Onni Software Ltd. and its contributors +Copyright (c) 2015-2022 by Onni Software Ltd. and its contributors All rights reserved. Redistribution and use in source and binary forms of the software as well @@ -13,7 +13,7 @@ that the following conditions are met: and/or other materials provided with the distribution. * Neither the name of 'pyexcel-xlsx' 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 e7fe8b2..ce89f0b 100644 --- a/README.rst +++ b/README.rst @@ -8,9 +8,6 @@ pyexcel-xlsx - Let you focus on data, instead of xlsx format .. image:: https://raw.githubusercontent.com/pyexcel/pyexcel-mobans/master/images/awesome-badge.svg :target: https://awesome-python.com/#specific-formats-processing -.. image:: https://github.com/pyexcel/pyexcel-xlsx/workflows/run_tests/badge.svg - :target: http://github.com/pyexcel/pyexcel-xlsx/actions - .. image:: https://codecov.io/gh/pyexcel/pyexcel-xlsx/branch/master/graph/badge.svg :target: https://codecov.io/gh/pyexcel/pyexcel-xlsx @@ -20,8 +17,7 @@ pyexcel-xlsx - Let you focus on data, instead of xlsx format .. image:: https://anaconda.org/conda-forge/pyexcel-xlsx/badges/version.svg :target: https://anaconda.org/conda-forge/pyexcel-xlsx -.. image:: https://pepy.tech/badge/pyexcel-xlsx/month - :target: https://pepy.tech/project/pyexcel-xlsx + .. image:: https://anaconda.org/conda-forge/pyexcel-xlsx/badges/downloads.svg :target: https://anaconda.org/conda-forge/pyexcel-xlsx @@ -136,7 +132,7 @@ Here's the sample code: >>> from pyexcel_xlsx import get_data >>> data = get_data("your_file.xlsx") >>> import json - >>> print(json.dumps(data, default=str)) + >>> print(json.dumps(data)) {"Sheet 1": [[1, 2, 3], [4, 5, 6]], "Sheet 2": [["row 1", "row 2", "row 3"]]} @@ -171,7 +167,7 @@ Continue from previous example: >>> # In reality, you might deal with xlsx file upload >>> # where you will read from requests.FILES['YOUR_XLSX_FILE'] >>> data = get_data(io) - >>> print(json.dumps(data, default=str)) + >>> print(json.dumps(data)) {"Sheet 1": [[1, 2, 3], [4, 5, 6]], "Sheet 2": [[7, 8, 9], [10, 11, 12]]} @@ -202,7 +198,7 @@ And let's pretend to read partial data: .. code-block:: python >>> partial_data = get_data("huge_file.xlsx", start_row=2, row_limit=3) - >>> print(json.dumps(partial_data, default=str)) + >>> print(json.dumps(partial_data)) {"huge": [[3, 23, 33], [4, 24, 34], [5, 25, 35]]} And you could as well do the same for columns: @@ -210,7 +206,7 @@ And you could as well do the same for columns: .. code-block:: python >>> partial_data = get_data("huge_file.xlsx", start_column=1, column_limit=2) - >>> print(json.dumps(partial_data, default=str)) + >>> print(json.dumps(partial_data)) {"huge": [[21, 31], [22, 32], [23, 33], [24, 34], [25, 35], [26, 36]]} Obvious, you could do both at the same time: @@ -220,7 +216,7 @@ Obvious, you could do both at the same time: >>> partial_data = get_data("huge_file.xlsx", ... start_row=2, row_limit=3, ... start_column=1, column_limit=2) - >>> print(json.dumps(partial_data, default=str)) + >>> print(json.dumps(partial_data)) {"huge": [[23, 33], [24, 34], [25, 35]]} .. testcode:: @@ -340,7 +336,7 @@ Then install relevant development requirements: #. pip install -r tests/requirements.txt Once you have finished your changes, please provide test case(s), relevant documentation -and update CHANGELOG.rst. +and update changelog.yml .. note:: @@ -359,7 +355,7 @@ On Linux/Unix systems, please launch your tests like this:: $ make -On Windows systems, please issue this command:: +On Windows, please issue this command:: > test.bat @@ -371,7 +367,7 @@ Please run:: $ make format -so as to beautify your code otherwise travis-ci may fail your unit test. +so as to beautify your code otherwise your build may fail your unit test. diff --git a/changelog.yml b/changelog.yml index 72b1569..3a40182 100644 --- a/changelog.yml +++ b/changelog.yml @@ -5,6 +5,8 @@ releases: - action: Updated details: - 'Compatability with openpyxl 3.1.0 and later' + date: 10.11.2024 + version: 0.6.1 - changes: - action: Updated details: diff --git a/docs/source/conf.py b/docs/source/conf.py index 64f8e7a..8046233 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,12 +23,12 @@ # -- Project information ----------------------------------------------------- project = 'pyexcel-xlsx' -copyright = '2015-2020 Onni Software Ltd.' +copyright = '2015-2022 Onni Software Ltd.' author = 'C.W.' # The short X.Y version -version = '0.6.0' +version = '0.6.1' # The full version, including alpha/beta/rc tags -release = '0.6.0' +release = '0.6.1' # -- General configuration --------------------------------------------------- @@ -58,7 +58,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -69,7 +69,8 @@ # -- Options for intersphinx extension --------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'https://docs.python.org/3/': None} +intersphinx_mapping = {'python': ('https://docs.python.org/3', + 'python-inv.txt')} # TODO: html_theme not configurable upstream html_theme = 'default' diff --git a/pyexcel-xlsx.yml b/pyexcel-xlsx.yml index 50c24d0..dc7a2e0 100644 --- a/pyexcel-xlsx.yml +++ b/pyexcel-xlsx.yml @@ -2,9 +2,9 @@ overrides: "pyexcel.yaml" name: "pyexcel-xlsx" project: "pyexcel-xlsx" nick_name: xlsx -version: 0.6.0 -current_version: 0.6.0 -release: 0.6.0 +version: 0.6.1 +current_version: 0.6.1 +release: 0.6.1 file_type: xlsx gitignore_language: Python is_on_conda: true diff --git a/setup.py b/setup.py index 45674c2..377ac61 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ NAME = "pyexcel-xlsx" AUTHOR = "C.W." -VERSION = "0.6.0" +VERSION = "0.6.1" EMAIL = "info@pyexcel.org" LICENSE = "New BSD" DESCRIPTION = ( @@ -37,7 +37,7 @@ "format" ) URL = "https://github.com/pyexcel/pyexcel-xlsx" -DOWNLOAD_URL = "%s/archive/0.6.0.tar.gz" % URL +DOWNLOAD_URL = "%s/archive/0.6.1.tar.gz" % URL FILES = ["README.rst", "CHANGELOG.rst"] KEYWORDS = [ "python", @@ -75,8 +75,8 @@ PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable) HERE = os.path.abspath(os.path.dirname(__file__)) -GS_COMMAND = ("gease pyexcel-xlsx v0.6.0 " + - "Find 0.6.0 in changelog for more details") +GS_COMMAND = ("gease pyexcel-xlsx v0.6.1 " + + "Find 0.6.1 in changelog for more details") NO_GS_MESSAGE = ("Automatic github release is disabled. " + "Please install gease to enable it.") UPLOAD_FAILED_MSG = (