Repository navigation
Migration guide from legacy garden packages
Guide for migrating existing garden packages to the new for using proper python package structure.
- Demo converting pure-python graph from https://github.com/kivy-garden/garden.graph to https://github.com/kivy-garden/graph
- Demo converting cython-python collider from https://github.com/kivy-garden/garden.collider to https://github.com/kivy-garden/collider
Here are the demo pure-python and cython-python flowers to be used as starting points for new flowers and for the migration.
The following steps use the garden graph package to demonstrate how to migrate a package to the new format.
-
Create a new empty repo with the name
graphin garden. -
In coveralls sync the
kivy-gardenrepos and then enable it. -
Clone the flower demo repo, if you haven't already. Otherwise make sure it is up to date with master: For a pure python flower:
git clone git@github.com:kivy-garden/flower.git
or for a cython-python flower:
git clone git@github.com:kivy-garden/cython_flower.git
-
Push the flower repo to github:
cd flower git push --mirror git@github.com:kivy-garden/graph.git -
Now clone
graphand the originalgarden.graphlocally:git clone git@github.com:kivy-garden/graph.git git clone git@github.com:kivy-garden/garden.graph.git
-
Merge
garden.graphinto the newgraph:cd graph git remote add original ../garden.graph git remote update git merge --allow-unrelated-histories original/masterIf there are any merge conflicts, resolve them and commit.
-
Migrate the original package structure into a pythonic structure.
- Remove the
kivy-garden/flowerdirectory and make a newkivy-garden/graphdirectory. - Copy all the original python modules e.g.
__init__.pyintokivy-garden/graph. - Fix the tests in
tests/to test the graph code. - open
setup.pyand replace all instances offlowerwithgraph. - Do any remaining cleanup, e.g. duplicate license files or readme.
- Commit all changes.
- Remove the
-
Test to make sure everything works, otherwise fix and commit (make sure
pytestis installed). Test install it to python and use it in your app:pip install . python -c "from kivy_garden.graph import Graph"
If it's a cython flower (graph isn't), compile it first:
PYTHONPATH=.:$PYTHONPATH python setup.py build_ext --inplaceThen run the tests:
PYTHONPATH=. python -m pytest tests/
-
Push to kivy-garden and remove the original garden remote
git push origin master git remote rm original
-
Verify that the travis tests pass.
-
Archive
garden.graph