Skip to content

Commit

Permalink
Merge pull request #30 from pyexcel/dev
Browse files Browse the repository at this point in the history
WIP - release 0.6.1 - pending unit test
  • Loading branch information
chfw authored Jan 30, 2022
2 parents 2393904 + c870ddf commit 7508050
Show file tree
Hide file tree
Showing 22 changed files with 160 additions and 91 deletions.
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ With your PR, here is a check list:
- [ ] Has all code lines tested?
- [ ] Has `make format` been run?
- [ ] Please update CHANGELOG.yml(not CHANGELOG.rst)
- [ ] Passes all Travis CI builds
- [ ] Has fair amount of documentation if your change is complex
- [ ] Agree on NEW BSD License for your contribution
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
name: lint code
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: lint
run: |
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
7 changes: 3 additions & 4 deletions .github/workflows/moban-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.PAT }}
- name: Set up Python
uses: actions/setup-python@v1
with:
Expand All @@ -20,10 +21,8 @@ jobs:
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
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run unit tests on Windows and Mac

on: [push, pull_request]

jobs:
test:
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

runs-on: ${{ matrix.os }}
name: run tests
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: install
run: |
pip --use-deprecated=legacy-resolver install -r requirements.txt
pip --use-deprecated=legacy-resolver install -r tests/requirements.txt
- name: test
run: |
pip freeze
nosetests --verbosity=3 --with-coverage --cover-package pyexcel_ods3 --cover-package tests tests --with-doctest --doctest-extension=.rst README.rst docs/source pyexcel_ods3
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
2 changes: 1 addition & 1 deletion .moban.d/custom_setup.py.jj2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'setup.py.jj2' %}
{% extends 'pyexcel-setup.py.jj2' %}

{%block platform_block%}
{%endblock%}
Expand Down
7 changes: 0 additions & 7 deletions .moban.d/custom_travis.yml.jj2

This file was deleted.

1 change: 0 additions & 1 deletion .moban.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ targets:
- README.rst: custom_README.rst.jj2
- setup.py: custom_setup.py.jj2
- "docs/source/conf.py": "docs/source/conf.py.jj2"
- .travis.yml: custom_travis.yml.jj2
- MANIFEST.in: MANIFEST.in.jj2
- "tests/requirements.txt": "tests/requirements.txt"
- .gitignore: commons-gitignore.jj2
18 changes: 18 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Optionally build your docs in additional formats such as PDF
formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

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 - 1.2.2022
--------------------------------------------------------------------------------

**added**

#. `#28 </~https://github.com/pyexcel/pyexcel-ods3/issues/28>`_: support datetime

0.6.0 - 8.10.2020
--------------------------------------------------------------------------------

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


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

In alphabetical order:
Expand All @@ -9,3 +9,4 @@ In alphabetical order:
* `Mateusz Konieczny </~https://github.com/matkoniecz>`_
* `Michael K. </~https://github.com/michael-k>`_
* `Stephen J. Fuhry </~https://github.com/fuhrysteve>`_
* `Vincent Raspal </~https://github.com/vinraspa>`_
2 changes: 1 addition & 1 deletion 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 Down
16 changes: 9 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ pyexcel-ods3 - Let you focus on data, instead of ods format
.. image:: https://raw.githubusercontent.com/pyexcel/pyexcel.github.io/master/images/patreon.png
:target: https://www.patreon.com/chfw

.. image:: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
.. image:: https://raw.githubusercontent.com/pyexcel/pyexcel-mobans/master/images/awesome-badge.svg
:target: https://awesome-python.com/#specific-formats-processing

.. image:: https://travis-ci.org/pyexcel/pyexcel-ods3.svg?branch=master
:target: http://travis-ci.org/pyexcel/pyexcel-ods3
.. image:: https://github.com/pyexcel/pyexcel-ods3/workflows/run_tests/badge.svg
:target: http://github.com/pyexcel/pyexcel-ods3/actions

.. image:: https://codecov.io/gh/pyexcel/pyexcel-ods3/branch/master/graph/badge.svg
:target: https://codecov.io/gh/pyexcel/pyexcel-ods3
Expand All @@ -21,7 +21,7 @@ pyexcel-ods3 - Let you focus on data, instead of ods format
:target: https://anaconda.org/conda-forge/pyexcel-ods3

.. image:: https://pepy.tech/badge/pyexcel-ods3/month
:target: https://pepy.tech/project/pyexcel-ods3/month
:target: https://pepy.tech/project/pyexcel-ods3

.. image:: https://anaconda.org/conda-forge/pyexcel-ods3/badges/downloads.svg
:target: https://anaconda.org/conda-forge/pyexcel-ods3
Expand Down Expand Up @@ -65,6 +65,8 @@ Known constraints

Fonts, colors and charts are not supported.

Nor to read password protected xls, xlsx and ods files.

Installation
================================================================================

Expand Down Expand Up @@ -346,7 +348,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 @@ -365,7 +367,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 @@ -377,7 +379,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.


Installation Note
Expand Down
6 changes: 6 additions & 0 deletions changelog.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: pyexcel-ods3
organisation: pyexcel
releases:
- changes:
- action: added
details:
- '`#28`: support datetime'
date: 1.2.2022
version: 0.6.1
- changes:
- action: added
details:
Expand Down
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
# -- Project information -----------------------------------------------------

project = 'pyexcel-ods3'
copyright = '2015-2020 Onni Software Ltd.'
author = 'chfw'
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
2 changes: 1 addition & 1 deletion lint.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pip install flake8
flake8 --exclude=.moban.d,docs,setup.py --builtins=unicode,xrange,long . && python setup.py checkdocs
flake8 --exclude=.moban.d,docs,setup.py --builtins=unicode,xrange,long . && python setup.py checkdocs
8 changes: 5 additions & 3 deletions pyexcel-ods3.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
overrides: "pyexcel.yaml"
name: "pyexcel-ods3"
nick_name: ods3
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: ods
is_on_conda: true
dependencies:
Expand All @@ -17,3 +17,5 @@ test_dependencies:
moban_command: false
description: |-
A wrapper library to read, manipulate and write data in ods format
python_requires: ">=3.6"
min_python_version: "3.6"
2 changes: 1 addition & 1 deletion pyexcel_ods3/odsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ods reader
:copyright: (c) 2015-2020 by Onni Software Ltd. & its contributors
:copyright: (c) 2015-2022 by Onni Software Ltd. & its contributors
:license: New BSD License
"""
from io import BytesIO
Expand Down
12 changes: 11 additions & 1 deletion pyexcel_ods3/odsw.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ods writer using ezodf
:copyright: (c) 2015-2020 by Onni Software Ltd. & its contributors
:copyright: (c) 2015-2022 by Onni Software Ltd. & its contributors
:license: New BSD License
"""
import types
Expand Down Expand Up @@ -44,6 +44,16 @@ def write_row(self, array):
seconds = cell.seconds % 60
cell = "PT%02dH%02dM%02dS" % (hours, minutes, seconds)
value_type = "time"
if value_type == "datetime":
cell = "%04d-%02d-%02dT%02d:%02d:%02d" % (
cell.year,
cell.month,
cell.day,
cell.hour,
cell.minute,
cell.second,
)
value_type = "date"
elif value_type == "float":
if cell > MAX_INTEGER:
raise IntegerAccuracyLossError("%s is too big" % cell)
Expand Down
Loading

0 comments on commit 7508050

Please sign in to comment.