Compare commits

...

10 Commits

Author SHA1 Message Date
decentral1se 2e8c254f3f
chore: rst -> md 2023-05-29 18:09:08 +02:00
Luke Murphy 0d14c01d0e
Add headers 2020-03-01 11:43:21 +00:00
Luke Murphy a26ca908df
Add app.cfg to example 2020-03-01 11:42:17 +00:00
Luke Murphy 8120c17241
Make release entry 2020-03-01 01:52:34 +00:00
Luke Murphy 03ffd82d6a
Add mirror 2020-03-01 01:51:07 +00:00
Luke Murphy 5c1623a32f
Get CI passing 2020-03-01 01:49:43 +00:00
Luke Murphy 9f5bd8f10d
Add changelog entry 2020-03-01 01:45:18 +00:00
Luke Murphy 1e8a2bf70b
Remove docs builds 2020-03-01 01:42:55 +00:00
Luke Murphy 7fe7526ded
Shape up README 2020-03-01 01:42:45 +00:00
Luke Murphy 94a2060276
Remove docs build 2020-03-01 01:42:36 +00:00
15 changed files with 130 additions and 264 deletions

View File

@ -16,8 +16,6 @@ matrix:
env: TOXENV=format
- python: 3.8
env: TOXENV=type
- python: 3.8
env: TOXENV=docs
- python: 3.8
env: TOXENV=metadata-release

5
CHANGELOG.md Normal file
View File

@ -0,0 +1,5 @@
# Flask_Calibrestekje 0.0.1 (2020-03-01)
## Project announcements
- Initial release is out! (#1)

View File

View File

@ -1,111 +0,0 @@
Introduction
------------
The flask-calibrestekje community is committed to providing an inclusive, safe,
and collaborative environment for all participants, regardless of their gender,
gender expression, race, ethnicity, religion, sexual orientation, sexual
characteristics, physical appearance, disability, or age. We encourage every
participant to be themselves, and must respect the rights of others. The code
of conduct is a set of guidelines that establishes shared values and ensures
that behaviors that may harm participants are avoided.
The values of the flask-calibrestekje community are focused on developing both
our individual and collective potential, supporting and empowering the most
marginalized, mutual respect, and an anti-violence approach that favors support
and collaboration among participants and the resolution of conflicts. A code of
conduct helps us co-exist in a more positive way and provides individuals who
are victims of negative behaviors with confidence that they will be supported
by the organization and the Flask-calibrestekje community, who respects and
stands behind the code of conduct.
The flask-calibrestekje community works towards providing a welcoming
environment where participants are treated with dignity and respect and are
free to be themselves. We encourage all participants to approach the
Flask-calibrestekje network with an open and positive attitude, engaging
constructively with others at all times.
Respect for Diversity & Inclusion
---------------------------------
We avoid comments, actions or propaganda that encourage discrimination related
to gender, gender expression, race, ethnicity, religion, sexual orientation,
sexual characteristics, physical appearance, disability, or age.
Respect Freedom of Expression
-----------------------------
We support an individual's freedom of expression, and will not make fun of
accents or make unsolicited grammatical corrections. We will strive to better
understand each other by not assuming experiences or beliefs, clarifying
meanings, and making an effort to speak clearly, avoiding jargon and acronyms.
Commitment to Non-Violence
--------------------------
We will not engage in any type of violence or aggression, including verbal
threats or complaints, intimidation, stalking or harassment, whether physically
or psychologically.
Rejection of Sexual Harassment
------------------------------
We understand sexual harassment as unwanted physical contact or insinuation of
a sexual nature, as well as displaying images, drawings or visual
representations of any kind that objectify members of any gender or reinforce
oppression. The only exception is if this is part of a session, workshop and/or
educational experience where showing these images is educational in nature.
Respect for Privacy
-------------------
We safeguard the privacy of the participants. This includes refraining from
posting or publishing information about attendees (including names and
affiliation) unless given clear permission, and avoid any type of unauthorized
video, audio recording, or photography.
Facilitate Participation & Collaboration
----------------------------------------
We work to create an environment that facilitates participation for all
participants. We will not engage in sustained disruption of discussions or
events, interrupt conversations in a way that negatively impacts collaboration,
or engage in toxic behaviours to attract negative attention to a participant.
We Care about the Integrity and Health of the Community
-------------------------------------------------------
We value the health of the community and will not engage in behaviour that can
negatively impact it. This includes contaminating food or drink with drugs, or
inciting or insisting on the consumption of alcohol, psychoactive substances,
etc.
Support Positive Interactions Among Participants
------------------------------------------------
We are committed to engaging constructively with others at all times. We will
not tolerate bullying, including requesting or mobilizing others, either in
person or online, to bully others.
Enforcement
-----------
Overseeing the code of conduct
==============================
The flask-calibrestekje community, composed of volunteers, oversees the code of
conduct, including addressing all incident reports. Breaking the code of
conduct may result in immediate expulsion from the flask-calibrestekje network.
How to Report an Incident
=========================
If you witness an incident or are the victim of one:
1. You can reach out directly via email at lukewm@riseup.net.
Acknowledgements
----------------
This code of conduct is inspired by the `IFF CoC`_.
.. _IFF CoC: https://www.internetfreedomfestival.org/wiki/index.php/Code_of_Conduct

60
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,60 @@
# Get started
Install [Tox](http://tox.readthedocs.io/).
# Run tests
``` bash
$ tox -e test
```
# Lint source
``` bash
$ tox -e lint
```
# Format source
``` bash
$ tox -e format
```
# Type check source
``` bash
$ tox -e type
```
# Build the documentation
``` bash
$ tox -e docs
$ tox -e docs-livereload
```
# Make a new release
Ensure metadata for packaging is correct.
``` bash
$ tox -e metadata-release
```
Generate the changelog with the next target version.
``` bash
$ export VERSION=1.0.1 tox -e changelog
```
Make a new Git tag.
``` bash
$ git tag -a 1.0.1
```
And finally, make a new release.
``` bash
$ tox -e release
```

View File

@ -1,70 +0,0 @@
Get started
-----------
Install `Tox`_.
.. _tox: http://tox.readthedocs.io/
Run tests
---------
.. code-block:: bash
$ tox -e test
Lint source
-----------
.. code-block:: bash
$ tox -e lint
Format source
-------------
.. code-block:: bash
$ tox -e format
Type check source
-----------------
.. code-block:: bash
$ tox -e type
Build the documentation
-----------------------
.. code-block:: bash
$ tox -e docs
$ tox -e docs-livereload
Make a new release
------------------
Ensure metadata for packaging is correct.
.. code-block:: bash
$ tox -e metadata-release
Generate the changelog with the next target version.
.. code-block:: bash
$ export VERSION=1.0.1 tox -e changelog
Make a new Git tag.
.. code-block:: bash
$ git tag -a 1.0.1
And finally, make a new release.
.. code-block:: bash
$ tox -e release

View File

@ -1 +1 @@
include LICENSE README.rst CHANGELOG.rst
include LICENSE README.md CHANGELOG.md

45
README.md Normal file
View File

@ -0,0 +1,45 @@
# flask-calibrestekje {#header}
[![Repository license](https://img.shields.io/badge/license-GPL-brightgreen.svg)](LICENSE)
[![PyPI package](https://badge.fury.io/py/flask-calibrestekje.svg)](https://badge.fury.io/py/flask-calibrestekje)
[![Travis CI result](https://travis-ci.com/decentral1se/flask-calibrestekje.svg?branch=master)](https://travis-ci.com/decentral1se/flask-calibrestekje)
[![Documentation status](https://readthedocs.org/projects/calibrestekje/badge/?version=latest)](https://calibrestekje.readthedocs.io/en/latest/)
[![Support badge](http://img.shields.io/liberapay/patrons/decentral1se.svg?logo=liberapay)](https://liberapay.com/decentral1se)
## Library prototyping based on Calibre with Flask
### Example
#### app.cfg
``` cfg
CALIBRESTEKJE_SQLITE_URL = "sqlite:///mymetadata.db"
```
#### app.py
``` python
from calibrestekje import Book
from flask import Flask, jsonify
from flask_calibrestekje import CalibreStekje
app = Flask(__name__)
app.config.from_pyfile("app.cfg")
db = CalibreStekje(app)
@app.route("/")
def home():
return jsonify({"book-count": db.session.query(Book).count()})
```
#### command-line
``` bash
$ export FLASK_APP=app.py
$ flask run
```
### Documentation
- <https://calibrestekje.readthedocs.io/>

View File

@ -1,46 +0,0 @@
.. _header:
************************
flask-calibrestekje
************************
.. image:: https://img.shields.io/badge/license-GPL-brightgreen.svg
:target: LICENSE
:alt: Repository license
.. image:: https://badge.fury.io/py/flask-calibrestekje.svg
:target: https://badge.fury.io/py/flask-calibrestekje
:alt: PyPI package
.. image:: https://travis-ci.com/decentral1se/flask-calibrestekje.svg?branch=master
:target: https://travis-ci.com/decentral1se/flask-calibrestekje
:alt: Travis CI result
.. image:: https://readthedocs.org/projects/flask-calibrestekje/badge/?version=latest
:target: https://flask-calibrestekje.readthedocs.io/en/latest/
:alt: Documentation status
.. image:: http://img.shields.io/liberapay/patrons/decentral1se.svg?logo=liberapay
:target: https://liberapay.com/decentral1se
:alt: Support badge
.. _introduction:
Library prototyping based on Calibre with Flask
------------------------------------
.. _example:
Example
*******
.. code-block:: python
# TODO
.. _documentation:
Documentation
*************
* https://flask-calibrestekje.readthedocs.io/

View File

@ -9,6 +9,6 @@ except ImportError:
try:
__version__ = pkg_resources.get_distribution('flask-calibrestekje').version
__version__ = pkg_resources.get_distribution("flask-calibrestekje").version
except Exception:
__version__ = 'unknown'
__version__ = "unknown"

View File

@ -1,5 +1,5 @@
from calibrestekje import init_session
from flask import _app_ctx_stack, current_app
from flask import _app_ctx_stack, current_app # type: ignore
class CalibreStekje(object):

View File

@ -13,9 +13,9 @@ include = '\.pyi?$'
[tool.towncrier]
directory = "changelog/"
filename = "CHANGELOG.rst"
package = "flask-calibrestekje"
package_dir = "flask-calibrestekje"
filename = "CHANGELOG.md"
package = "flask_calibrestekje"
package_dir = "flask_calibrestekje"
[[tool.towncrier.type]]
directory = "removal"

View File

@ -15,16 +15,16 @@ include_trailing_comma = True
[metadata]
name = flask-calibrestekje
author = decentral1se
author_email = lukewm@riseup.net
author_email = cellarspoon@riseup.net
maintainer = decentral1se
maintainer_email = lukewm@riseup.net
url = https://github.com/decentral1se/flask-calibrestekje
maintainer_email = cellarspoon@riseup.net
url = https://git.coopcloud.tech/decentral1se/flask-calibrestekje
project_urls =
Source Code = https://github.com/decentral1se/flask-calibrestekje
Source Code = https://git.coopcloud.tech/decentral1se/flask-calibrestekje
Documentation = https://flask-calibrestekje.readthedocs.io/
Maintainer Support = https://liberapay.come/decentral1se
description = Library prototyping based on Calibre with Flask
long_description = file: README.rst
long_description = file: README.md
license = GPLv3
license_file = LICENSE
classifiers =

View File

@ -2,9 +2,9 @@
def test_version_fails_gracefully(mocker):
target = 'pkg_resources.get_distribution'
target = "pkg_resources.get_distribution"
mocker.patch(target, side_effect=Exception())
from flask-calibrestekje.__init__ import __version__
from flask_calibrestekje.__init__ import __version__
assert __version__ == 'unknown'
assert __version__ == "unknown"

25
tox.ini
View File

@ -5,7 +5,6 @@ envlist =
sort
format
type
docs
changelog
metadata-release
skip_missing_interpreters = True
@ -17,47 +16,33 @@ deps =
pytest
pytest-cov
pytest-mock
commands = pytest test/ --cov={toxinidir}/flask-calibrestekje/ --no-cov-on-fail {posargs}
commands = pytest test/ --cov={toxinidir}/flask_calibrestekje/ --no-cov-on-fail {posargs}
[testenv:lint]
description = lint the source
skipdist = True
deps = flake8
commands = flake8 {posargs} flask-calibrestekje/ test/
commands = flake8 {posargs} flask_calibrestekje/ test/
[testenv:sort]
description = sort the source
skipdist = True
deps = isort
commands = isort {posargs:-rc -c} -sp setup.cfg flask-calibrestekje/ test/
commands = isort {posargs:-rc -c} -sp setup.cfg flask_calibrestekje/ test/
[testenv:format]
description = format the source
skipdist = True
basepython = python3.8
deps = black
commands = black {posargs:--check} flask-calibrestekje/ test/
commands = black {posargs:--check} flask_calibrestekje/ test/
[testenv:type]
description = type check the source
basepython = python3.8
skipdist = True
deps = mypy
commands = mypy flask-calibrestekje/ test/
[testenv:docs]
description = build the documentation
skipdist = True
deps =
sphinx
sphinx_rtd_theme
commands = python -m setup build_sphinx
[testenv:docs-livereload]
description = invoke sphinx-autobuild to build and reload the documentation
commands = python -m sphinx_autobuild docs/source docs/build
deps = sphinx-autobuild>=0.7.1,<1.0
extras = docs
commands = mypy flask_calibrestekje/ test/
[testenv:changelog]
description = draw up the new changelog