how do I install and test my changes to jira-python?

I'd like to contribute to jira-python.  I cloned the repo and made my changes locally, now I need to install and test.  However, every method I've used to install the package from a local directory has failed with the following:

Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/davidmcbride/projects/python_jira/jira/setup.py", line 201, in <module>
        **get_metadata(base_path, NAME, 'package_meta.py')
      File "/Users/davidmcbride/projects/python_jira/jira/setup.py", line 39, in get_metadata
        exec(code, scope)
      File "/Users/davidmcbride/projects/python_jira/jira/jira/package_meta.py", line 103, in <module>
        __version__ = get_version()
      File "/Users/davidmcbride/projects/python_jira/jira/jira/package_meta.py", line 38, in get_version
        version = base_version.base_version
    AttributeError: 'tuple' object has no attribute 'base_version'

I've tried 'pip install -e', 'easy_install', and 'python setup.py'.  I also made sure that 'setuptools' was updated.

Obviously, people are contributing to jira-python, so I guess I just need to understand the workflow better.  

Using OS X 10.11.6

 

2 answers

0 vote
David Currie Atlassian Team Sep 26, 2016

Which version of Python are you using?

I, too, would like to know the best way to do this, but here's what I did.

  1. create a virtualenv in a working directory, e,g. virtualenv venv
  2. activate your virtualenv, e.g. source venv/bin/activate
  3. pip install pytest-runner (Not sure why this isn't handled by pip install of jira)
  4. pip install -e the JIRA library, e.g. pip install -e git+git@github.com:pycontribs/jira.git#egg=Package
  5. cd venv/src/package/JIRA
  6. start developing

If anyone has anything better, PLEASE share!  Thanks!!

I've gotten a little bit further, but am stuck again . . .  the file test.local has this bit of instruction:

# Settings for using the Vagrant VM from atlassian
# (see https://developer.atlassian.com/static/connect/docs/latest/developing/developing-locally.html)
# a user "jira_user" with password "jira" needs to be created manually

The problem now is that the vagrant image is no longer available from Atlassian.  They now seem to offer only a temporary cloud instance for testing:

See https://developer.atlassian.com/static/connect/docs/latest/guides/development-setup.html#cloud-dev

I happen to have the vagrant image, but it seems that the tests have changed and they no longer work with the vagrant image. 

Anyone have any insight here?  Thanks!!

OK, getting a bit better at this, I think . . .

  1. Fork python-JIRA
  2. virtualenv jira
  3. source jira/bin/activate
  4. pip install pytest-runner
  5. pip install -e pip install -e git+git@github.com:YOUR_USERNAME/jira#egg=Package
  6. cd jira/src/package
  7. pip install -r requirements-dev.txt
  8. edit tests.local to point to a dev JIRA instance (see above)
  9. ./test.local tests

  10. edit code
  11. goto 9

Would love to hear what @Sorin Sbarnea thinks about this

D'oh!  Forgot one thing!  After step 6 above, make sure you're able to track changes in the upstream code:

git remote add upstream git@github.com:pycontribs/jira.git

Then you can pull changes from upstream,

git pull upstream develop

Clone and run `make test`, this will run the tests, no need to try to create the venv yourself as that's done by make. There are several other make commands available that are of great help, just check the Makefile, is easy to read.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 2 hours ago in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

13 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you