# Ignition repo now with branches

**URL:** <https://forum.inductiveautomation.com/t/ignition-repo-now-with-branches/37932>\
**Category:** Ignition\
**Tags:** ignition79, ignition80, scripting\
**Created:** [August 20, 2020, 1:51am UTC](https://forum.inductiveautomation.com/t/ignition-repo-now-with-branches/37932 "2020-08-20T01:51:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [August 20, 2020, 1:51am UTC](https://forum.inductiveautomation.com/t/ignition-repo-now-with-branches/37932/1 "2020-08-20T01:51:16Z")

</div>

In the past, I’ve shared with this community the Ignition repo I maintain over at [GitHub](https://github.com/thecesrom/Ignition), and in the past couple of weeks, I’ve been experimenting with branches.

So now I have **main** , **7.9** , and **jython**.

### `main`

Includes all `system.*` scripting functions included in version 8.0.16, as well as `java/javax` stubs in cases where Java cannot be installed. Project interpreter: Python 2.7.18.

### `7.9`

Includes all `system.*` scripting functions included in version 7.9.16, as well as `java/javax` stubs in cases where Java cannot be installed. Project interpreter: Python 2.7.18.

### `jython`

Includes all `system.*` scripting functions included in version 8.0.16. Project interpreter: Jython 2.7.1.

And in no way I am a Java expert, so please excuse any/all blunders.

### How do I clone a branch in particular?

```auto
# main
git clone --single-branch --branch main https://github.com/thecesrom/Ignition.git

# jython
git clone --single-branch --branch jython https://github.com/thecesrom/Ignition.git

# 7.9
git clone --single-branch --branch 7.9 https://github.com/thecesrom/Ignition.git

```

### Just want the code?

You may download the source code for any version here: [https://github.com/thecesrom/Ignition/releases](https://github.com/thecesrom/Ignition/releases)

I intend to keep it up to date, as long as work permits.

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [August 20, 2020, 2:12am UTC](https://forum.inductiveautomation.com/t/ignition-repo-now-with-branches/37932/2 "2020-08-20T02:12:38Z")

</div>

Geeze this is quite thorough.

I could definitely see it being useful to add the ability to write unittests for your project scripts, as in 8+ they are just stored as .py files in the project folder.

Really if there was a way to write unit tests directly within Ignition and utilize the builtin libraries that way it would be fantastic, but unfortunately I understand its not necessarily easy due to the way the unittest module has to be called.

Either way good work!

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [August 20, 2020, 7:07pm UTC](https://forum.inductiveautomation.com/t/ignition-repo-now-with-branches/37932/3 "2020-08-20T19:07:41Z")

</div>

As much as I like the idea of the Designer as an IDE, I don’t think it is technically possible.

One of the main reasons I started using PyCharm, and the motivation behind creating the stubs for all Scripting Functions, was because I was able to get code completion on my libraries, not just on `system.*`. And while I have not created unit tests I do believe PyCharm or Visual Studio Code (and many others) offer better integration with the ‘unittest’ framework.

If at some point I do include unit testing on my projects, I’ll share it with the community.

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [November 2, 2020, 9:02pm UTC](https://forum.inductiveautomation.com/t/ignition-repo-now-with-branches/37932/4 "2020-11-02T21:02:49Z")

</div>

Where do you put the library in relation to your `ignition/data/project/my-project/ignition/script-python` directory? I am looking to do a bit more of my development in VSCode for other reasons, but I am not exactly sure how to get it to see `system` as a valid library with the built in file structure.

i.e.

```auto
.
+-- script-1
| +-- code.py
| +-- resource.json
+-- script-2
| +-- code.py
| +-- resource.json
+-- package-1
| +-- script-1
| | +-- code.py
| | +--resource.json
| +-- script-2
| | +-- code.py
| | +--resource.json

```

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [November 3, 2020, 1:38am UTC](https://forum.inductiveautomation.com/t/ignition-repo-now-with-branches/37932/5 "2020-11-03T01:38:36Z")

</div>

I really wanted vscode to work for my projects, but as I mentioned here [Ignition mock scripts on GitHub](http://forum.inductiveautomation.com/t/ignition-mock-scripts-on-github/16468), after trying a couple of IDEs, PyCharm CE is the one that worked best for me.

So, I just have to add `Ignition` as a dependency for my project[s], and it all works.

To add `Ignition` as a dependency to your project in PyCharm, just do the following:

1. Open your project
2. **File** \> **Open** , and select **Ignition**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/1/f15e300d84dd0877f81eb403563d8158b2b87ad5.png)
3. When prompted, choose **Attach**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/9/c9340d5c25a69d837252e51fec39d3f7b879bfc5.png)
4. And just like that, you’ve added `Ignition` as a dependency  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/5/d5581fee361fd2669f53c28f65a369ce109bb457.png)

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [November 3, 2020, 1:56am UTC](https://forum.inductiveautomation.com/t/ignition-repo-now-with-branches/37932/6 "2020-11-03T01:56:36Z")

</div>

Ohhhh now I understand, it’s the lack of ability to add library dependencies, and so you would need to add Imports to all of your code

I feel like combining your repository with a VS extension would be a pretty easy way to add an “Ignition” extension that automatically includes the libraries

Not sure I know enough of the tools to create something like that, but it would for sure be useful!

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [September 2, 2021, 2:37am UTC](https://forum.inductiveautomation.com/t/ignition-repo-now-with-branches/37932/7 "2021-09-02T02:37:12Z")

</div>

So, today I embarked into creating a `setup.py` file for the Ignition library, `pip`-installed it on a virtual environment hoping it will work for Visual Studio code, but unfortunately it didn’t. Although it did work on PyCharm.

If there are packaging/vscode experts out there, please let me know if I’m missing something.

`setup.py`:

```python
#!/usr/bin/env python2
# -*- coding: utf-8 -*-

import io
import os

from setuptools import find_packages, setup

NAME = "ignition-api"
DESCRIPTION = "Ignition Scripting API"
URL = "https://github.com/thecesrom/Ignition"
EMAIL = "cesar@thecesrom.dev"
AUTHOR = "César Román"
REQUIRES_PYTHON = "==2.7.18"
VERSION = "8.1.9"

here = os.path.abspath(os.path.dirname( __file__ ))

try:
    with io.open(os.path.join(here, "README.md"), encoding="utf-8") as readme:
        long_description = "\n" + readme.read()
except IOError:
    long_description = DESCRIPTION

setup(
    name=NAME,
    version=VERSION,
    description=DESCRIPTION,
    long_description=long_description,
    long_description_content_type="text/markdown",
    author=AUTHOR,
    author_email=EMAIL,
    python_requires=REQUIRES_PYTHON,
    url=URL,
    packages=find_packages(where="src"),
    package_dir={"": "src"},
    license="MIT",
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2 :: Only",
        "Programming Language :: Python :: 2.7",
    ],
)

```
