Advice on creating a new environment using OpenAI Gym
This stackoverflow post provides a good answer.  It recommends creating the environment as a new package.

Note the updated link to the instructions on OpenAI.

So that's what I did and it's honestly not that much work and then you can import the environment into your script like this:

import gym
import gym_foo
env = gym.make('foo-v0')


This blog post also describes the process in a little bit more detail.