From 902c810358fd198d45dbfae5cd9deee227cd6c5f Mon Sep 17 00:00:00 2001 From: A-Bak <59940328+A-Bak@users.noreply.github.com> Date: Tue, 18 Oct 2022 15:48:35 +0200 Subject: [PATCH] Create python-publish.yml --- .github/workflows/python-publish.yml | 48 ++++++++++++++++++++++++++++ MANIFEST.in | 6 ++-- ReadMe.md | 14 +++++--- setup.py | 4 +-- 4 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..6a3c57a --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,48 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Publish LSystemRenderer to PyPi + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + build-n-publish: + name: Build and publish to PyPI + runs-on: ubuntu-latest + + steps: + - name: Ls1 + run: ls + + - name: Checkout source + uses: actions/checkout@v2 + + - name: Ls2 + run: ls + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Build source and wheel distributions + run: | + python -m pip install --upgrade build twine + python setup.py sdist + twine check --strict dist/* + + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.LSYSTEM_RENDERER_API_TOKEN }} diff --git a/MANIFEST.in b/MANIFEST.in index 96c7bc4..1d3e033 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,8 +1,6 @@ include .gitignore include LICENCE - -include *.py include *.md -recursive-include conf *.yaml -recursive-include conf *.py \ No newline at end of file +recursive-include conf * +recursive-include lsystem * \ No newline at end of file diff --git a/ReadMe.md b/ReadMe.md index c5b846a..43f3097 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -4,10 +4,13 @@ An L-system or Lindenmayer system is a parallel rewriting system and a type of f # Installation -You can download and install the latest release using pip. -```bash -pip install LSystemRenderer -``` +You can download and install the latest release as follows: + +1. Open a terminal +2. Run `git clone https://github.com/A-Bak/l-system` +3. Switch to the directory `cd l-system` +4. Run `python setup.py install` +5. Done ## Usage @@ -32,6 +35,9 @@ Where `LSYSTEM_NAME` is the name of the L-System configuration file. There are s |10.|[squared_squares]()| |11.|[stochastic_plant_edge_rewriting]()| +NOTE: if you want to create your own L-System configuration files add them to the +`conf/lsystem` directory. + ### Plant Edge Rewriting 1 ![Plant Edge Rewriting 1](./resources/plant_edge_rewriting_1.gif) diff --git a/setup.py b/setup.py index 1ee51d4..6711508 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setuptools.setup( name="LSystemRenderer", - version="0.0.3", + version="0.0.9", author="A-Bak", author_email="adam.bak.work@gmail.com", description="Display images generated by L-Systems.", @@ -18,7 +18,7 @@ keywords="l-system generative-art image-generation grammar renderer", url="https://github.com/A-Bak/l-system", packages=setuptools.find_packages(), - data_files=[("conf", glob.glob("conf/*/*.*"))], + include_package_data=True, python_requires=">=3.6", install_requires=required, classifiers=[