Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
honzajavorek committed Oct 21, 2020
0 parents commit 09fbfdf
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 0 deletions.
20 changes: 20 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2020 Digismoothie s.r.o.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38 changes: 38 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
public-test
===========

Sample public project setup.

Usage
-----

Add the package to your dependencies. If you're working on a project managed by `poetry <https://python-poetry.org/>`_, use the following::

$ poetry add public-test

If you're working on a project managed by `pipenv <https://pipenv.kennethreitz.org/>`_, use the following::

$ pipenv install public-test

After that, you should be able to import the library in your Python code::

from public_test import answer
print(answer)

Development
-----------

This library itself is managed by `poetry <https://python-poetry.org/>`_. Read the docs for basic usage. You can run tests like this::

$ poetry run pytest

To release a new version of the library, follow these steps:

#. Be sure to be on the ``master`` Git branch.
#. Decide whether your changes are `breaking, improvement, or a bug fix <https://semver.org/>`_. Use the poetry's `version command <https://python-poetry.org/docs/cli/#version>`_ to raise the version number.
#. Read the new number from the poetry's output and commit the change with ``git commit -am "release vX.Y.Z"``.
#. Tag the commit with ``git tag vX.Y.Z``
#. Release a new version by pushing it all to GitHub: ``git push origin master --tags``
#. The CI builds the package and publishes it to the `PyPI <https://pypi.org/project/public-test/>`_.

New releases get listed at `tags <https://github.com/digismoothie/django-toolbox/tags>`_. If you like your colleagues, for each release click on *Edit tag* and write a title and description (changelog).
165 changes: 165 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions public_test/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__version__ = '0.1.0'


answer = 42
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[tool.poetry]
name = "public-test"
version = "0.1.0"
description = "Sample public project setup"
authors = [
"Digismoothie s.r.o. <[email protected]>",
]
license = "MIT"
readme = "README.rst"
repository = "https://github.com/digismoothie/public-test"
include = [
"LICENSE.txt",
]

[tool.poetry.dependencies]
python = "^3.8"

[tool.poetry.dev-dependencies]
pytest = "^4.6"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Empty file added tests/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions tests/test_public_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from public_test import __version__, answer


def test_version():
assert __version__ == '0.1.0'


def test_answer():
assert answer == 42

0 comments on commit 09fbfdf

Please sign in to comment.