How to get PyBites up and running on your machine

Posted by Pybites on Tue 20 December 2016 in Tools • 1 min read

This is also a useful ref for future collaborators ...

We're open source right? ;)

Pybites install guide

# we have a src, output and theme (Flex) repo, use --recursive to get all
$ git clone --recursive [email protected]:pybites/pybites.github.io-src pybites
$ cd pybites

# set up env and install dependencies
$ virtualenv venv (might need: virtualenv -p python3 venv)
$ source venv/bin/activate
$ pip install -r requirements.txt

# add some content
$ cd content
$ vi new-blog-post.md ; wq!

# check changes on localhost
$ cd ..
$ make html && make serve

# push this new content to the parent -src repo
$ git add . 
$ git commit -m "my new blog post"
$ git push

# push the static blog change to the child -io repo
# wait: this is a duplicate step, I don't like duplication!
# ...

As we have 2 repos: -src for code, -io for generated static content, ideally we want to automate the publishing to -io, so we can just focus on the main repo (-src).

Here is where git hooks come into play. cd into .git/hooks and add below script, name it "pre-push", update your WORKING_DIR and chmod 755 it ...

UPDATE: we abondonded this hook, because it led to some conflicts / unnecessary work, not worth automating this step. We push manually to -src / -io these days.

>>> next(PyBites)

Get our 'Become a Better Python Developer' cheat sheet sent straight to your inbox by signing up for our Newsletter: