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

David McBride September 25, 2016

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 votes
Guy Matz October 27, 2016

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!!

Guy Matz November 4, 2016

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!!

Guy Matz December 14, 2016

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

Guy Matz December 14, 2016

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

Sorin Sbarnea December 14, 2016

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.

0 votes
Dave C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 26, 2016

Which version of Python are you using?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events