Skip to content

Commit 3e0efd0

Browse files
committed
📚 update project meta data
1 parent 9862d28 commit 3e0efd0

File tree

11 files changed

+73
-71
lines changed

11 files changed

+73
-71
lines changed

.github/workflows/lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
- name: Set up Python
1212
uses: actions/setup-python@v1
1313
with:
14-
python-version: 3.8
14+
python-version: 3.11
1515
- name: lint
1616
run: |
17-
pip install flake8
18-
pip install -r tests/requirements.txt
17+
pip --use-deprecated=legacy-resolver install flake8
18+
pip --use-deprecated=legacy-resolver install -r tests/requirements.txt
1919
flake8 --exclude=.moban.d,docs,setup.py --builtins=unicode,xrange,long .
2020
python setup.py checkdocs

.github/workflows/moban-update.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ jobs:
88
- uses: actions/checkout@v2
99
with:
1010
ref: ${{ github.head_ref }}
11+
token: ${{ secrets.PAT }}
1112
- name: Set up Python
1213
uses: actions/setup-python@v1
1314
with:
14-
python-version: '3.7'
15+
python-version: '3.11'
1516
- name: check changes
1617
run: |
17-
pip install moban gitfs2 pypifs moban-jinja2-github moban-ansible
18+
pip install markupsafe==2.0.1
19+
pip install ruamel.yaml moban gitfs2 pypifs moban-jinja2-github moban-ansible
1820
moban
1921
git status
2022
git diff --exit-code
2123
- name: Auto-commit
2224
if: failure()
23-
uses: docker://cdssnc/auto-commit-github-action
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
uses: stefanzweifel/git-auto-commit-action@v4
2626
with:
27-
args: >-
27+
commit_message: >-
2828
This is an auto-commit, updating project meta data,
2929
such as changelog.rst, contributors.rst

.github/workflows/pythonpublish.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@ on:
55
types: [created]
66

77
jobs:
8-
deploy:
8+
pypi-publish:
9+
name: upload release to PyPI
910
runs-on: ubuntu-latest
11+
# Specifying a GitHub environment is optional, but strongly encouraged
12+
environment: pypi
13+
permissions:
14+
# IMPORTANT: this permission is mandatory for trusted publishing
15+
id-token: write
1016
steps:
17+
# retrieve your distributions here
1118
- uses: actions/checkout@v1
1219
- name: Set up Python
1320
uses: actions/setup-python@v1
@@ -16,11 +23,9 @@ jobs:
1623
- name: Install dependencies
1724
run: |
1825
python -m pip install --upgrade pip
19-
pip install setuptools wheel twine
20-
- name: Build and publish
21-
env:
22-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
26+
pip install setuptools wheel
27+
- name: Build
2428
run: |
2529
python setup.py sdist bdist_wheel
26-
twine upload dist/*
30+
- name: Publish package distributions to PyPI
31+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1-
name: run_tests
1+
name: Run unit tests on Windows, Ubuntu and Mac
22

33
on: [push, pull_request]
44

55
jobs:
6+
67
test:
8+
name: ${{ matrix.os }} / ${{ matrix.python_version }}
9+
runs-on: ${{ matrix.os }}-latest
710
strategy:
8-
fail-fast: false
9-
matrix:
10-
python-version: [3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12]
11-
os: [macos-latest, ubuntu-latest, windows-latest]
11+
fail-fast: false
12+
matrix:
13+
os: [Ubuntu]
14+
python_version: ["3.9.16"]
1215

13-
runs-on: ${{ matrix.os }}
14-
name: run tests
1516
steps:
1617
- uses: actions/checkout@v2
1718
- name: Set up Python
18-
uses: actions/setup-python@v1
19+
uses: actions/setup-python@v5
1920
with:
20-
python-version: ${{ matrix.python-version }}
21+
python-version: ${{ matrix.python_version }}
22+
architecture: x64
23+
2124
- name: install
2225
run: |
23-
pip install -r requirements.txt
24-
pip install -r tests/requirements.txt
26+
pip --use-deprecated=legacy-resolver install -r requirements.txt
27+
pip --use-deprecated=legacy-resolver install -r tests/requirements.txt
28+
pip --use-deprecated=legacy-resolver install -r rnd_requirements.txt
2529
- name: test
2630
run: |
2731
pip freeze
28-
pytest
32+
nosetests --verbosity=3 --with-coverage --cover-package pyexcel_ods --cover-package tests tests --with-doctest --doctest-extension=.rst README.rst docs/source pyexcel_ods
2933
- name: Upload coverage
3034
uses: codecov/codecov-action@v1
3135
with:
32-
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
36+
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

CONTRIBUTORS.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22

3-
3 contributors
3+
4 contributors
44
================================================================================
55

66
In alphabetical order:
77

88
* `Azamat H. Hackimov <https://github.com/winterheart>`_
99
* `John Vandenberg <https://github.com/jayvdb>`_
1010
* `Mateusz Konieczny <https://github.com/matkoniecz>`_
11+
* `Pyrox <https://github.com/pyrox0>`_

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ that the following conditions are met:
1313
and/or other materials provided with the distribution.
1414

1515
* Neither the name of 'pyexcel-ods' nor the names of the contributors
16-
may not be used to endorse or promote products derived from this software
16+
may be used to endorse or promote products derived from this software
1717
without specific prior written permission.
1818

1919
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND

README.rst

+21-35
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ pyexcel-ods - Let you focus on data, instead of ods format
88
.. image:: https://raw.githubusercontent.com/pyexcel/pyexcel-mobans/master/images/awesome-badge.svg
99
:target: https://awesome-python.com/#specific-formats-processing
1010

11-
.. image:: https://github.com/pyexcel/pyexcel-ods/workflows/run_tests/badge.svg
12-
:target: http://github.com/pyexcel/pyexcel-ods/actions
13-
1411
.. image:: https://codecov.io/gh/pyexcel/pyexcel-ods/branch/master/graph/badge.svg
1512
:target: https://codecov.io/gh/pyexcel/pyexcel-ods
1613

1714
.. image:: https://badge.fury.io/py/pyexcel-ods.svg
1815
:target: https://pypi.org/project/pyexcel-ods
1916

2017

18+
2119
.. image:: https://pepy.tech/badge/pyexcel-ods/month
2220
:target: https://pepy.tech/project/pyexcel-ods
2321

@@ -41,19 +39,11 @@ is the other sister library that has no external dependency but do ods reading o
4139
Support the project
4240
================================================================================
4341

44-
If your company has embedded pyexcel and its components into a revenue generating
45-
product, please support me on github, `patreon <https://www.patreon.com/bePatron?u=5537627>`_
46-
or `bounty source <https://salt.bountysource.com/teams/chfw-pyexcel>`_ to maintain
47-
the project and develop it further.
48-
49-
If you are an individual, you are welcome to support me too and for however long
50-
you feel like. As my backer, you will receive
51-
`early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts>`_.
52-
53-
And your issues will get prioritized if you would like to become my patreon as `pyexcel pro user`.
54-
55-
With your financial support, I will be able to invest
56-
a little bit more time in coding, documentation and writing interesting posts.
42+
If your company uses pyexcel and its components in a revenue-generating product,
43+
please consider supporting the project on GitHub or
44+
`Patreon <https://www.patreon.com/bePatron?u=5537627>`_. Your financial
45+
support will enable me to dedicate more time to coding, improving documentation,
46+
and creating engaging content.
5747

5848

5949
Known constraints
@@ -93,15 +83,8 @@ As a standalone library
9383

9484
>>> import os
9585
>>> import sys
96-
>>> if sys.version_info[0] < 3:
97-
... from StringIO import StringIO
98-
... else:
99-
... from io import BytesIO as StringIO
100-
>>> PY2 = sys.version_info[0] == 2
101-
>>> if PY2 and sys.version_info[1] < 7:
102-
... from ordereddict import OrderedDict
103-
... else:
104-
... from collections import OrderedDict
86+
>>> from io import BytesIO
87+
>>> from collections import OrderedDict
10588

10689

10790
Write to an ods file
@@ -145,7 +128,7 @@ Here's the sample code to write a dictionary to an ods file:
145128
>>> data = OrderedDict()
146129
>>> data.update({"Sheet 1": [[1, 2, 3], [4, 5, 6]]})
147130
>>> data.update({"Sheet 2": [[7, 8, 9], [10, 11, 12]]})
148-
>>> io = StringIO()
131+
>>> io = BytesIO()
149132
>>> save_data(io, data)
150133
>>> # do something with the io
151134
>>> # In reality, you might give it to your http response
@@ -297,18 +280,18 @@ You got to wrap the binary content with stream to get ods working:
297280
+-------+-------+-------+
298281
299282
300-
Writing to a StringIO instance
283+
Writing to a BytesIO instance
301284
********************************************************************************
302285

303-
You need to pass a StringIO instance to Writer:
286+
You need to pass a BytesIO instance to Writer:
304287

305288
.. code-block:: python
306289
307290
>>> data = [
308291
... [1, 2, 3],
309292
... [4, 5, 6]
310293
... ]
311-
>>> io = StringIO()
294+
>>> io = BytesIO()
312295
>>> sheet = pe.Sheet(data)
313296
>>> io = sheet.save_to_memory("ods", io)
314297
>>> # then do something with io
@@ -340,26 +323,29 @@ Then install relevant development requirements:
340323
#. pip install -r tests/requirements.txt
341324

342325
Once you have finished your changes, please provide test case(s), relevant documentation
343-
and update CHANGELOG.rst.
326+
and update changelog.yml
344327

345328
.. note::
346329

347330
As to rnd_requirements.txt, usually, it is created when a dependent
348-
library is not released. Once the dependecy is installed
331+
library is not released. Once the dependency is installed
349332
(will be released), the future
350333
version of the dependency in the requirements.txt will be valid.
351334

352335

353336
How to test your contribution
354-
------------------------------
337+
--------------------------------------------------------------------------------
355338

356-
Although `pytest` and `doctest` are both used in code testing, it is adviable that unit tests are put in tests. `doctest` is incorporated only to make sure the code examples in documentation remain valid across different development releases.
339+
Although `nose` and `doctest` are both used in code testing, it is advisable
340+
that unit tests are put in tests. `doctest` is incorporated only to make sure
341+
the code examples in documentation remain valid across different development
342+
releases.
357343

358344
On Linux/Unix systems, please launch your tests like this::
359345

360346
$ make
361347

362-
On Windows systems, please issue this command::
348+
On Windows, please issue this command::
363349

364350
> test.bat
365351

@@ -371,7 +357,7 @@ Please run::
371357

372358
$ make format
373359

374-
so as to beautify your code otherwise travis-ci may fail your unit test.
360+
so as to beautify your code otherwise your build may fail your unit test.
375361

376362

377363
Credits

docs/source/conf.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
# The theme to use for HTML and HTML Help pages. See the documentation for
5858
# a list of builtin themes.
5959
#
60-
html_theme = 'alabaster'
60+
html_theme = 'sphinx_rtd_theme'
6161

6262
# Add any paths that contain custom static files (such as style sheets) here,
6363
# relative to this directory. They are copied after the builtin static files,
@@ -68,7 +68,8 @@
6868
# -- Options for intersphinx extension ---------------------------------------
6969

7070
# Example configuration for intersphinx: refer to the Python standard library.
71-
intersphinx_mapping = {'https://docs.python.org/3/': None}
71+
intersphinx_mapping = {'python': ('https://docs.python.org/3',
72+
'python-inv.txt')}
7273
# TODO: html_theme not configurable upstream
7374
html_theme = 'default'
7475

pyexcel-ods.yml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ test_dependencies:
1313
- pyexcel
1414
- psutil
1515
- pyexcel-xls
16+
- pytest
17+
- pytest-cov
1618
description: A wrapper library to read, manipulate and write data in ods format
1719
python_requires: ">=3.6"
1820
min_python_version: "3.6"

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def filter_out_test_code(file_handle):
193193
keywords=KEYWORDS,
194194
python_requires=PYTHON_REQUIRES,
195195
extras_require=EXTRAS_REQUIRE,
196-
tests_require=["pytest", "pytest-cov"],
196+
tests_require=["nose"],
197197
install_requires=INSTALL_REQUIRES,
198198
packages=PACKAGES,
199199
include_package_data=True,

tests/requirements.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
pytest
2-
pytest-cov
1+
nose
2+
mock;python_version<"3"
33
codecov
4+
coverage
45
flake8
56
black
67
isort
@@ -11,3 +12,5 @@ moban_jinja2_github
1112
pyexcel
1213
psutil
1314
pyexcel-xls
15+
pytest
16+
pytest-cov

0 commit comments

Comments
 (0)