Skip to content

Commit

Permalink
📚 update build chain and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Nov 10, 2024
1 parent 42ad7d8 commit bfb68d7
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions .github/workflows/moban-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 12 additions & 7 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
25 changes: 14 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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
--------------------------------------------------------------------------------

Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@


4 contributors
5 contributors
================================================================================

In alphabetical order:

* `Benoit Pierre <https://github.com/benoit-pierre>`_
* `Chun-Sheng, Li <https://github.com/peter279k>`_
* `Craig Anderson <https://github.com/craiga>`_
* `John Vandenberg <https://github.com/jayvdb>`_
* `Stephen J. Fuhry <https://github.com/fuhrysteve>`_
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
22 changes: 9 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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"]]}
Expand Down Expand Up @@ -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]]}
Expand Down Expand Up @@ -202,15 +198,15 @@ 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:

.. 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:
Expand All @@ -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::
Expand Down Expand Up @@ -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::

Expand All @@ -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

Expand All @@ -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.



Expand Down
2 changes: 2 additions & 0 deletions changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 6 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------

Expand Down Expand Up @@ -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,
Expand All @@ -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'

Expand Down
6 changes: 3 additions & 3 deletions pyexcel-xlsx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@

NAME = "pyexcel-xlsx"
AUTHOR = "C.W."
VERSION = "0.6.0"
VERSION = "0.6.1"
EMAIL = "info@pyexcel.org"
LICENSE = "New BSD"
DESCRIPTION = (
"A wrapper library to read, manipulate and write data in xlsx and xlsm" +
"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",
Expand Down Expand Up @@ -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 = (
Expand Down

0 comments on commit bfb68d7

Please sign in to comment.