Skip to content

Commit

Permalink
🤝 demo 2: a project, generated 4 years ago, gets synchronized with la…
Browse files Browse the repository at this point in the history
…test parent template. MolSSI/cookiecutter-cms#81
  • Loading branch information
chfw committed Oct 13, 2020
1 parent 052c201 commit 7d0d350
Show file tree
Hide file tree
Showing 24 changed files with 381 additions and 88 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: chfw
patreon: chfw
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
With your PR, here is a check list:

- [ ] Has test cases written?
- [ ] 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
29 changes: 29 additions & 0 deletions .github/workflows/moban-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: [push]

jobs:
run_moban:
runs-on: ubuntu-latest
name: synchronize templates via moban
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: check changes
run: |
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 }}
with:
args: >-
This is an auto-commit, updating project meta data,
such as changelog.rst, contributors.rst
26 changes: 26 additions & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- 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 }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.moban.hashes
*.pyc
*~
.coverage
31 changes: 0 additions & 31 deletions .moban.d/LICENSE

This file was deleted.

File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions .moban.d/requirements.txt

This file was deleted.

14 changes: 3 additions & 11 deletions .moban.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
overrides: "git://github.com/pyexcel/pyexcel-mobans!/mobanfile.yaml"
configuration:
configuration_dir: "commons/config"
template_dir:
- "commons/templates"
- ".moban.d"
configuration: libxlsxwpy.yml
targets:
- README.rst: README.rst
- setup.py: setup.py
- LICENSE: LICENSE.jj2
- MANIFEST.in: MANIFEST.in.jj2
- test.sh: test.sh.jj2
- test.bat: test.sh.jj2
- "tests/requirements.txt": "tests/requirements.txt"
- README.rst: custom_README.rst.jj2
- setup.py: custom_setup.py.jj2
3 changes: 1 addition & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Change log
======================

================================================================================
6 changes: 6 additions & 0 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


No contributors yet
=======================

* Your github link will be listed here after your PR is merged
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2016 by Onni Software Ltd. and its contributors
Copyright (c) 2015-2020 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 Expand Up @@ -27,4 +27,4 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
DAMAGE.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
include README.rst
include LICENSE
include CHANGELOG.rst
recursive-include tests *
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
all: test

test:
test: lint
bash test.sh

install_test:
pip install -r tests/requirements.txt

lint:
bash lint.sh

format:
bash format.sh

git-diff-check:
git diff --exit-code
108 changes: 103 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,64 @@
================================================================================
libxlsxwpy - Let you focus on data, instead of xlsx format
libxlsxwpy - Let you focus on data, instead of file formats
================================================================================

.. image:: https://api.travis-ci.org/pyexcel/libxlsxwpy.svg?branch=master
.. 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
:target: https://awesome-python.com/#specific-formats-processing

.. image:: https://travis-ci.org/pyexcel/libxlsxwpy.svg?branch=master
:target: http://travis-ci.org/pyexcel/libxlsxwpy

.. image:: https://codecov.io/github/pyexcel/libxlsxwpy/coverage.png
:target: https://codecov.io/github/pyexcel/libxlsxwpy
.. image:: https://codecov.io/gh/pyexcel/libxlsxwpy/branch/master/graph/badge.svg
:target: https://codecov.io/gh/pyexcel/libxlsxwpy

.. image:: https://badge.fury.io/py/libxlsxwpy.svg
:target: https://pypi.org/project/libxlsxwpy


.. image:: https://pepy.tech/badge/libxlsxwpy/month
:target: https://pepy.tech/project/libxlsxwpy/month


.. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg
:target: https://gitter.im/pyexcel/Lobby

.. image:: https://img.shields.io/static/v1?label=continuous%20templating&message=%E6%A8%A1%E7%89%88%E6%9B%B4%E6%96%B0&color=blue&style=flat-square
:target: https://moban.readthedocs.io/en/latest/#at-scale-continous-templating-for-open-source-projects

.. image:: https://img.shields.io/static/v1?label=coding%20style&message=black&color=black&style=flat-square
:target: https://github.com/psf/black

Support the project
================================================================================

If your company has embedded pyexcel and its components into a revenue generating
product, please support me on github, `patreon <https://www.patreon.com/bePatron?u=5537627>`_
or `bounty source <https://salt.bountysource.com/teams/chfw-pyexcel>`_ to maintain
the project and develop it further.

If you are an individual, you are welcome to support me too and for however long
you feel like. As my backer, you will receive
`early access to pyexcel related contents <https://www.patreon.com/pyexcel/posts>`_.

And your issues will get prioritized if you would like to become my patreon as `pyexcel pro user`.

With your financial support, I will be able to invest
a little bit more time in coding, documentation and writing interesting posts.

**libxlsxwpy** is a plain python wrapper for libxlsxwriter, a c library. And it only support writing strings for now.

Known constraints
==================

Fonts, colors and charts are not supported.

Introduction
================================================================================
**libxlsxwpy** is a plain python wrapper for libxlsxwriter, a c library. And it only support writing strings for now.



Installation
================================================================================
Expand Down Expand Up @@ -57,6 +100,61 @@ Here is the python code for `the equivalent C code <http://libxlsxwriter.github.
>>> os.unlink("myexcel.xlsx")


Development guide
================================================================================

Development steps for code changes

#. git clone https://github.com/pyexcel/libxlsxwpy.git
#. cd libxlsxwpy

Upgrade your setup tools and pip. They are needed for development and testing only:

#. pip install --upgrade setuptools pip

Then install relevant development requirements:

#. pip install -r rnd_requirements.txt # if such a file exists
#. pip install -r requirements.txt
#. pip install -r tests/requirements.txt

Once you have finished your changes, please provide test case(s), relevant documentation
and update CHANGELOG.rst.

.. note::

As to rnd_requirements.txt, usually, it is created when a dependent
library is not released. Once the dependecy is installed
(will be released), the future
version of the dependency in the requirements.txt will be valid.


How to test your contribution
------------------------------

Although `nose` 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.

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

$ make

On Windows systems, please issue this command::

> test.bat


Before you commit
------------------------------

Please run::

$ make format

so as to beautify your code otherwise travis-ci may fail your unit test.




License
================================================================================

Expand Down
3 changes: 3 additions & 0 deletions format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
isort $(find libxlsxwpy -name "*.py"|xargs echo) $(find tests -name "*.py"|xargs echo)
black -l 79 libxlsxwpy
black -l 79 tests
5 changes: 5 additions & 0 deletions libxlsxwpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ sources:
- pymodule.c
- book.c
- sheet.c
test_dependencies:
- pyexcel
- pyexcel-xls
description: A plain python wrapper for libxlsxwriter, a C library.
python_requires: ">=3.6"
min_python_version: "3.6"
2 changes: 2 additions & 0 deletions lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pip install flake8
flake8 --exclude=.moban.d,docs,setup.py --builtins=unicode,xrange,long . && python setup.py checkdocs
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xlsxwriter
Loading

0 comments on commit 7d0d350

Please sign in to comment.