Skip to content

Commit

Permalink
Merge pull request #58 from alcarney/develop
Browse files Browse the repository at this point in the history
New Release v0.6.0
  • Loading branch information
alcarney authored Oct 7, 2018
2 parents 84f3a74 + c2eecc5 commit 07fd1fd
Show file tree
Hide file tree
Showing 39 changed files with 1,514 additions and 106 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ docs/_static/examples

*.png
!docs/**/*.png
!img/*.png

.eggs/
*.egg-info/
Expand Down
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ matrix:
- env: "TOXENV=lint"
python: "3.6"

- env: "TOXENV=benchmark"
python: "3.6"

- env: "TOXENV=docs-check"
python: "3.6"

- env: "TOXENV=docs-build"
python: "3.6"

Expand All @@ -35,9 +29,11 @@ after_success:

notifications:
webhooks:
url: https://webhooks.gitter.im/e/4bfa4fbff35ebee0a9d2
urls:
- https://webhooks.gitter.im/e/4bfa4fbff35ebee0a9d2

deploy:
# <publish-docs>
- provider: pages
skip-cleanup: true
github-token: $GH_TOKEN
Expand All @@ -47,7 +43,9 @@ deploy:
branch: develop
condition: $TOXENV = docs-build
python: 3.6
# </publish-docs>

# <publish-package>
- provider: pypi
distributions: "sdist bdist_wheel"
user: alcarney
Expand All @@ -56,3 +54,4 @@ deploy:
on:
condition: $TOXENV = py36
python: 3.6
# </publish-package>
42 changes: 40 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
v0.5.0 2018-09-27
-----------------
v0.6.0 - 2018-10-07
-------------------

Added
^^^^^

Users
"""""

- New :code:`Triangle` shape
- Shapes can now be inverted using the :code:`~` operator.

Contributors
""""""""""""

- Added new shape :code:`InvertedShape` which handles the inversion of a shape
behind the scenes.
- Tests for all the composite shapes and operators.
- More documentation on how to get involved

Changed
^^^^^^^

Users
"""""

- Shapes now have defined :code:`__repr__` methods, including shapes that have
been combined, where a representation of a tree will be produced showing how
the various shapes have been combined together.
- Preview images in Jupyter notebooks are now larger by default

This release of :code:`stylo` was brought to you thanks to contributions from
the following awesome people!

- `mvinoba <https://github.com/mvinoba>`_


v0.5.0 - 2018-09-27
-------------------

Added
^^^^^
Expand Down Expand Up @@ -27,6 +64,7 @@ Contributors
interval :math:`[ymin, ymax]`
- We now make use of the :code:`[scripts]` section of :code:`Pipfile` so
running common commands is now easier to remember

+ :code:`pipenv run test`: to run the test suite
+ :code:`pipenv run lint`: to lint the codebase
+ :code:`pipenv run docs`: to run a full build of the documentation
Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pytest-benchmark = "*"
tox = "*"
pre-commit = "*"
jupyter = "*"
black = "*"

[scripts]
test = "tox -q -e py36,py37 -- -n auto"
Expand Down
78 changes: 70 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,82 @@ About
:alt: Join the chat at https://gitter.im/stylo-py/Lobby
:target: https://gitter.im/stylo-py/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

**DISCLAIMER!: Stylo is still in its early stages, many of the core
concepts are yet to be decided on. The interface can change without warning and
features may be added or removed without warning!**
**Stylo is in early development, while it is useable we cannot make any
stability guarantees.**

Stylo is library that provides a number of tools that aim to make the process of creating
images and animations using nothing but some code and some mathematics possible. Since my
drawing abilities are very limited I created stylo as a way of me trying to close the gap
between my imagination and my artistic ability.
Stylo is a Python library that allows you to create images and animations
powered by your imagination and a little mathematics. While mathematics is very
much at the core you do not have to be a mathematician to use it!

For example here is a simple image of a boat that can be made with just a few
lines of Python


.. image:: /_static/examples/a-boat.png
:align: center
:width: 75%

.. image:: /img/a-boat.png
:align: center
:width: 75%

.. testcode:: readme-boat

from stylo.image import LayeredImage
from stylo.color import FillColor
from stylo.shape import Circle, Rectangle, Triangle
from stylo.domain.transform import translate

# Let's define some colours
black = FillColor("000000")
seablue = FillColor("0000ff")
white = FillColor("ffffff")
yellow = FillColor("ffff00")
red = FillColor("dd2300")

# Now for the shapes we will draw
sun = Circle(-7, 3.4, 1.5)
sea = Circle(0, -55, 55)
sails = Triangle((0.1, 0.6), (2.5, 0.6), (0.1, 3.5)) | Triangle((-0.1, 0.6), (-1.5, 0.6), (-0.1, 3.5))
boat = Rectangle(0, 0, 3.5, 1) | Triangle((1.75, -0.5), (1.75, 0.5), (2.25, 0.5))
mast = Rectangle(0, 2, 0.125, 3)

# Move some into position
boat = boat >> translate(0, -2)
sails = sails >> translate(0, -2)
mast = mast >> translate(0, -2)

# Finally let's bring it all together
image = LayeredImage(background="99ddee", scale=8)

image.add_layer(sun, yellow)
image.add_layer(sea, seablue)
image.add_layer(boat, red)
image.add_layer(mast, black)
image.add_layer(sails, white)

image(1920, 1080, filename="docs/_static/examples/a-boat.png");

Installation
^^^^^^^^^^^^

Stylo is available on PyPi and can easily be installed using Pip:
Stylo is available for Python 3.5+ and can be installed using Pip:

.. code::
$ pip install stylo
Be sure to check out the `documentation <https://alcarney.github.io/stylo>`_
(under construction) for details on how to get started with stylo.

Contributing
^^^^^^^^^^^^

Contributions are welcome! Be sure to checkout the `Contributing
<https://alcarney.github.io/stylo/contributing/>`_ section of the documentation
to get started.

**Note:** While :code:`stylo` itself supports Python 3.5+, due to some of the
development tools we use you need to have Python 3.6+ in order to contribute
**code** to the library. Other versions of Python work just as well if you are
looking to contribute documentation.
Binary file added docs/_static/new-issue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/new-release.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/the-repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions docs/contributing/code/code-style.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/contributing/code/index.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/contributing/code/reference/domain-system.rst

This file was deleted.

14 changes: 0 additions & 14 deletions docs/contributing/docs/index.rst

This file was deleted.

18 changes: 0 additions & 18 deletions docs/contributing/docs/the-build.rst

This file was deleted.

16 changes: 16 additions & 0 deletions docs/contributing/get-started/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _contribute_get_started:

Getting Started
===============

This section of the documentation is all about giving new contributors the
information they need to get stuck in with making their first contribution.
This section is broken down into a number of smaller sections with the first
section containing information that every contributor should know and is where
we recommend new contributors to start. The remaining sections are then
organised by what kind of contribution you want to make.


New Contributors - Start Here
-----------------------------

36 changes: 34 additions & 2 deletions docs/contributing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,43 @@
Contributing
============

Welcome to the contributor's corner! This section of the documentation is
devoted to explaining what you need to know in order to make a contribution to
:code:`stylo`. Since contributions come in all shapes and sizes we'll put some
links below just click on the one you feel matches you the most and it should
take you where you need to go.

- :ref:`contribute_how_to`
- :ref:`contribute_ref`

.. _contribute_how_to:

How do I ..?
------------

- How do I :ref:`contribute_tutorial_open_issue`?
- How do I :ref:`contribute_tutorial_fork_repository`?
- How do I :ref:`contribute_tutorial_devenv_setup`?


.. _contribute_ref:

Tell me more about ..
---------------------

- Tell me more about the :ref:`Documentation Build <contribute_ref_docs_build>`
- Tell me more about the :ref:`Branching Policy <contribute_ref_branching>`
- Tell me more about the :ref:`contribute_ref_code_style`
- Tell me more about the :ref:`Release Process <contribute_ref_release>`
- Tell me more about the :ref:`Setup.py file <contribute_ref_setup_py>`

Index
-----

.. toctree::
:maxdepth: 2

docs/index
code/index
get-started/index
reference/index
tutorials/index

59 changes: 59 additions & 0 deletions docs/contributing/reference/branching-policy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.. _contribute_ref_branching:

The Branching Policy
====================

.. attention::

This page assumes that you are confortable with using git.

The Golden Rule
---------------

If there is one thing you take away from this page it is this **we never work on
master**.

We never do any work directly on the :code:`master` branch because the release
process (explained in much greater detail :ref:`here <contribute_ref_release>`)
is set up to automatically package and publish code that is committed to the
:code:`master` branch.

So that we don't accidentally publish broken or work in progress code we do all
our work based on the :code:`develop` branch. The only time a commit is made to
the master branch is when a new release of :code:`stylo` is made. Again it's
recommended that you read :ref:`contribute_ref_release` page for more information
on this process.

Our Recommendations
-------------------

.. todo::

Link to various articles explaining some of these steps in more detail when
they are written.

.. tip::

Git can get very scary, very quickly. If you are having trouble with it at any
stage you can always drop a message in the
`chatroom <https://gitter.im/stylo-py/Lobby>`_ we'll always be happy to help.

With that out of the way here is the recommended workflow when making changes to
the repository.

1. Make sure you have the :code:`develop` branch checked out and that it is up
to date with the latest in the main repository.
2. Create a new branch to do your work on. It helps if you choose name that
indicates the sort of work you intend to do e.g. :code:`add-new-shape` or
:code:`fix-issue-123`
3. Make whatever changes and commits you need to complete the task.
4. When you have finished, update your :code:`develop` branch to the
latest and rebase your work on top of it.
5. Push your changes up to your fork and open a PR against the :code:`develop`
branch on the main repository.

Don't worry if you're not using git "perfectly" at the end of the day it is a
tool used for bookkeeping and the process outlined above is only a
recommendation. What's more important is your contribution so focus on that we
can always guide you through the bookkeeping steps when it comes to getting your
contribution merged.
Loading

0 comments on commit 07fd1fd

Please sign in to comment.