GithubHelp home page GithubHelp logo

regro / rever Goto Github PK

View Code? Open in Web Editor NEW
74.0 74.0 33.0 729 KB

Releaser of Versions

Home Page: https://regro.github.io/rever-docs/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

rever's People

Contributors

anki-code avatar asmeurer avatar bam241 avatar basnijholt avatar cdeil avatar cj-wright avatar dholth avatar djsutherland avatar hadim avatar igortg avatar mariusvniekerk avatar melissawm avatar msarahan avatar rjkoch avatar saraedum avatar sbillinge avatar scopatz avatar takluyver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rever's Issues

Paper release

It would be nice to have some activities for "releasing" papers. This could include:

  • Latex builder (with author/title support?)
  • Paper Bibtex citation builder/updater
  • Send email to collaborators with the paper
  • Something to submit the citation to Regolith
  • Something to submit the paper to Arxiv? (We may need a submission API for Arxiv)
  • Submit publicly facing blurb to various platforms (Regolith news, Twitter, etc.)

Integration tests

We might consider running a version bump, changelog, tag (non push) of rever inside the circle build. This way we can test the usage patterns for rever implemented in rever (especially since rever's own rever.xsh may be the best example of usage).

BUG: rc not defined

I get the following doing conda_forge

activity-error:conda_forge:activity failed with execption:
Traceback (most recent call last):
  File "/home/christopher/dev/rever/rever/activity.xsh", line 59, in __call__
    self.func(*args, **kwargs)
  File "/home/christopher/dev/rever/rever/activities/conda_forge.xsh", line 126, in _func
    gh, username = github.login(return_username=True)
  File "/home/christopher/dev/rever/rever/github.xsh", line 106, in login
    write_credfile(credfile)
  File "/home/christopher/dev/rever/rever/github.xsh", line 29, in dec
    return f(*args, **kwargs)
  File "/home/christopher/dev/rever/rever/github.xsh", line 600, in write_credfile
NameError: name 'rc' is not defined

I think this is the problematic line: https://github.com/regro/rever/blob/master/rever/github.xsh#L88

cd as context manager

Does xonsh already have a nice way to cd as a context manager? If not, we should add something here, as it comes up often.

BUG: conda-forge organization account?

I got the following:

(regro) christopher@christopher-ubuntu ~/dev/xpdSim master $ rever -a conda_forge 0.1.2
activity-start:conda_forge:starting activity conda_forge
Fork doesn't exist creating feedstock fork...
activity-error:conda_forge:activity failed with execption:
Traceback (most recent call last):
  File "/home/christopher/dev/rever/rever/activity.xsh", line 62, in __call__
    self.func(*args, **kwargs)
  File "/home/christopher/dev/rever/rever/activities/conda_forge.xsh", line 147, in _func
    repo.create_fork(username)
  File "/home/christopher/mc/envs/regro/lib/python3.6/site-packages/github3/decorators.py", line 33, in auth_wrapper
    return func(self, *args, **kwargs)
  File "/home/christopher/mc/envs/regro/lib/python3.6/site-packages/github3/repos/repo.py", line 765, in create_fork
    json = self._json(resp, 202)
  File "/home/christopher/mc/envs/regro/lib/python3.6/site-packages/github3/models.py", line 154, in _json
    if self._boolean(response, status_code, 404) and response.content:
  File "/home/christopher/mc/envs/regro/lib/python3.6/site-packages/github3/models.py", line 176, in _boolean
    raise exceptions.error_for(response)
github3.exceptions.UnprocessableEntity: 422 'CJ-Wright' is the login for a user account. You must pass the login for an organization account.
rewinding to 8854a6547dcabc67c15cc605e41cf8b6f0827eb4

Tag shorthand without <tag>

It seems I ran into an error

christopher@christopher-ubuntu ~/dev/xpdAcq tag $ rever 0.6.0
Activity 'version_bump' has already been completed!
activity-start:tag:starting activity tag
Updated tag '0.6.0' (was 066fd6e)
fatal: tag shorthand without <tag>
activity-error:tag:activity failed with execption:
Traceback (most recent call last):
  File "/home/christopher/dev/rever/rever/activity.xsh", line 54, in __call__
    self.func(*args, **kwargs)
  File "/home/christopher/dev/rever/rever/activities/tag.xsh", line 40, in _func
    vcsutils.push(remote, target)
  File "/home/christopher/dev/rever/rever/vcsutils.xsh", line 30, in vcs_dispatcher
    return func(*args, **kwargs)
  File "/home/christopher/dev/rever/rever/vcsutils.xsh", line 130, in git_push
    git push @(remote) @(target)
  File "/home/christopher/mc/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 19208, in subproc_captured_hiddenobject
    return run_subproc(cmds, captured='hiddenobject')
  File "/home/christopher/mc/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 19171, in run_subproc
    command.end()
  File "/home/christopher/mc/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 13721, in end
    self._end(tee_output=tee_output)
  File "/home/christopher/mc/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 13740, in _end
    self._raise_subproc_error()
  File "/home/christopher/mc/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 13850, in _raise_subproc_error
    output=self.output)
subprocess.CalledProcessError: Command '['/usr/bin/git', 'push', 'git@github.com:CJ-Wright/xpdAcq.git', 'tag']' returned non-zero exit status 128
rewinding to 10ed3b1f15a093e964788e61d3ab933c95a98619

Thoughts on what I could be doing wrong?
(If this is not me just using the software wrong we may want a more verbose error)

reaver.xsh as dict?

Would a dict be a potentially better format for the environmental variables? This way they could be loaded from a more standard format (json, yaml, pure python?). This would also make these files more friendly to other applications which may not speak xonsh.

KeyError: 'Unknown environment variable: $SHELL'

I have $XONSH_SHOW_TRACEBACK = True and I get this printed a lot (it doesn't cause it to fail).

xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 13063, in run
    r = self.f(self.args, sp_stdin, sp_stdout, sp_stderr, spec)
  File "/opt/conda/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 12885, in proxy_two
    return f(args, stdin)
  File "/opt/conda/lib/python3.6/site-packages/xontrib/xonda.xsh", line 92, in _xonda
    _activate(args[1])
  File "/opt/conda/lib/python3.6/site-packages/xontrib/xonda.xsh", line 70, in _activate
    $SHELL)
  File "/opt/conda/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 16621, in __getitem__
    raise KeyError(e.format(key))
KeyError: 'Unknown environment variable: $SHELL'

BUG: updated github authentication was ignored by program

behavior was as follows:

  1. tried to run rever for a new release
  2. fixed multiple errors in various places and kept rerunning....
  3. finally got the github push which failed
  4. realized that in the config the push authentication was given as ssh but my account is set up using https
  5. changed the authentication command in setup.py to the https command
  6. retried rever but it kept looking for the ssh authentication for some reason

@CJ-Wright is looking into this, but I am reporting for completeness

BUG: track which remote got tagged

One may want to run a trial run tag against a remote that is not production (I certainly did as I didn't want to mess things up on my first outing with rever). Currently this won't work since if the log is not git tracked then it will know that the tag was successful (at least against the other remote). Also we might aim to be as verbose as possible in the logs anyway just for the sake of provenance.

Table of Activities

I imagine that for many of the most simple use cases the users are not expected to read the API documentation, especially since this can be a command line driven system. Having a simple table of some of the basic usages (tagging, version bumping, changelog-ing) would be helpful.

Create staged-recipe PR

If we are going to do conda-forge PRs maybe we should have something that builds the initial PR into staged-recipes.

Pieces

  1. Initial provisioning with version/sha (after PushTag so we can pull it from GH?)
  2. Read requirements from requirements/build and requirements/run.
  3. Read test deps from requirements/test

Questions

  1. Do we want to push after creating the recipe?
  2. Do we want to run the tests in the recipe?
  3. Do we want to pull the maintainers/licence info/other info from somewhere?

DOC: Changlog does not explain the usage pattern

There is a use pattern to get Changelog to work properly.

All PRs must have an addition to the news folder as a new file (or some other user defined file). During the release process the news info get collated and moved into a changlog file.

More broadly we may want to capture some critical use patterns in its own rever docs file. These patterns are not formally part of the rever code base but are needed to make the most of the software.

Docker Docs

It might be nice to have some docs on how Docker needs to be set up to work with rever.

Setup CI

It might be nice to (as a setup task) bootstap Circle, Travis, etc support.

Use Doctr to build/deploy docs

Is there any interest in using Doctr to build/deploy the docs? I noticed that the web docs have not been updated recently (they still note xonsh as the development target).

How do I force rever to rerun an activity?

If I edit an activity, it doesn't get run again. I have to give it a new name. I thought there was some log I could delete, but I don't see one in the current directory.

Wizard

We may want a wizard (ala xonsh setup) for setting up the rever.xsh file.

Can't bump version number

I'm probably doing something wrong, but trying to push a new release of xonda and it seems dead set on remaining version 0.2.2

gil@bad_cat ~/git/xonda master ๐Ÿš  rever 0.3
Activity 'changelog' has already been completed!
Activity 'conda_forge' has already been completed!
Activity 'ghrelease' has already been completed!
Activity 'tag' has already been completed!
Activity 'version_bump' has already been completed!
activity-start:pypi:starting activity pypi
running sdist
running egg_info
creating xonda.egg-info
writing xonda.egg-info/PKG-INFO
writing dependency_links to xonda.egg-info/dependency_links.txt
writing top-level names to xonda.egg-info/top_level.txt
writing manifest file 'xonda.egg-info/SOURCES.txt'
reading manifest file 'xonda.egg-info/SOURCES.txt'
writing manifest file 'xonda.egg-info/SOURCES.txt'
running check
creating xonda-0.2.2
creating xonda-0.2.2/xonda.egg-info
creating xonda-0.2.2/xontrib
copying files to xonda-0.2.2...
copying setup.py -> xonda-0.2.2
copying xonda.egg-info/PKG-INFO -> xonda-0.2.2/xonda.egg-info
copying xonda.egg-info/SOURCES.txt -> xonda-0.2.2/xonda.egg-info
copying xonda.egg-info/dependency_links.txt -> xonda-0.2.2/xonda.egg-info
copying xonda.egg-info/not-zip-safe -> xonda-0.2.2/xonda.egg-info
copying xonda.egg-info/top_level.txt -> xonda-0.2.2/xonda.egg-info
copying xontrib/xonda.xsh -> xonda-0.2.2/xontrib
Writing xonda-0.2.2/setup.cfg
creating dist
Creating tar archive
package init file 'xontrib/__init__.py' not found (or not a regular file)
warning: sdist: standard file not found: should have one of README, README.rst, README.txt

removing 'xonda-0.2.2' (and everything under it)
running upload
Submitting dist/xonda-0.2.2.tar.gz to https://upload.pypi.org/legacy/
Upload failed (400): File already exists.
error: Upload failed (400): File already exists.
activity-error:pypi:activity failed with execption:
Traceback (most recent call last):
  File "/home/gil/miniconda3/lib/python3.6/site-packages/rever/activity.xsh", line 62, in __call__
    self.func(*args, **kwargs)
  File "/home/gil/miniconda3/lib/python3.6/site-packages/rever/activities/pypi.xsh", line 84, in _func
    p = ![$PYTHON setup.py @(commands)]
  File "/home/gil/miniconda3/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 19376, in subproc_captured_hiddenobject
    return run_subproc(cmds, captured='hiddenobject')
  File "/home/gil/miniconda3/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 19339, in run_subproc
    command.end()
  File "/home/gil/miniconda3/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 12645, in end
    self._end(tee_output=tee_output)
  File "/home/gil/miniconda3/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 12664, in _end
    self._raise_subproc_error()
  File "/home/gil/miniconda3/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 12774, in _raise_subproc_error
    output=self.output)
subprocess.CalledProcessError: Command '['/home/gil/miniconda3/bin/python', 'setup.py', 'sdist', 'upload']' returned non-zero exit status 1.
rewinding to 860bf3cfc7557bb7a419a97ef08a061c87d9ef61

ENH: nicely handle white space for version_bump

It is very possible that we will want to have whitespace in the version replacement (eg it's in an indented block (setup.py?)). Currently this white space must be hard coded into the rever.xsh file (see rever's file for an example). This is rather inelegant and could cause tons of problems. Would it be possible to keep track of this white space and maintain it upon replacement?

get linter from xonsh

Would it be possible to make the xonsh linter (which checks for news entries) and lambda stuff more broadly available?
This would be very helpful to bringing rever using projects into the news -> CHANGELOG workflow.
Can we subscribe other repos to the xonsh lambda instance?
If not can we provide instructions for users to set up their own lambda driven linter?

Tag vs. Release

Should there be a release activity in addition to tag? I assume that release will need to upload a tar and zip or get them from somewhere.

Cannot run a specific activity

If I use rever -e activity I get a KeyError.

$rever 1.1.rc1 -e test
Traceback (most recent call last):
  File "/Users/aaronmeurer/anaconda3/bin/rever", line 3, in <module>
    main()
  File "/Users/aaronmeurer/anaconda3/lib/python3.5/site-packages/rever/main.xsh", line 151, in main
    env_main(args=args)
  File "/Users/aaronmeurer/anaconda3/lib/python3.5/site-packages/rever/main.xsh", line 140, in env_main
    running_activities(ns)
  File "/Users/aaronmeurer/anaconda3/lib/python3.5/site-packages/rever/main.xsh", line 45, in running_activities
    $RUNNING_ACTIVITIES = acts[entry]
KeyError: 'test'

Rever fails on conda-forge task if user hasn't already forked feedstock

xonda is using rever now thanks to @CJ-Wright and also has a brand new conda package, so I've never updated it manually (and @CJ-Wright submitted the recipe).

On running a release I get:

wrote /home/gil/.config/rever/github/gforsyth-xonda.cred
secured permisions of /home/gil/.config/rever/github/gforsyth-xonda.cred
Cloning into 'rever/xonda-feedstock'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
activity-error:conda_forge:activity failed with execption:
Traceback (most recent call last):
  File "/home/gil/miniconda3/lib/python3.6/site-packages/rever/activity.xsh", line 62, in __call__
    self.func(*args, **kwargs)
  File "/home/gil/miniconda3/lib/python3.6/site-packages/rever/activities/conda_forge.xsh", line 136, in _func
    p = ![git clone @(origin) @(feedstock_dir)]
  File "/home/gil/miniconda3/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 19376, in subproc_captured_hiddenobject
    return run_subproc(cmds, captured='hiddenobject')
  File "/home/gil/miniconda3/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 19339, in run_subproc
    command.end()
  File "/home/gil/miniconda3/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 12645, in end
    self._end(tee_output=tee_output)
  File "/home/gil/miniconda3/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 12664, in _end
    self._raise_subproc_error()
  File "/home/gil/miniconda3/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 12774, in _raise_subproc_error
    output=self.output)
subprocess.CalledProcessError: Command '['/usr/bin/git', 'clone', '[email protected]:gforsyth/xonda-feedstock.git', 'rever/xonda-feedstock']' returned non-zero exit status 128.

Since user has already entered credentials for github, can the fork of the feedstock be automated?

Parameterized activities

There doesn't seem to be an easy way to pass arguments to an activity. Right now I am doing something like this

$ACTIVITIES = [
    'test_tarball27',
    'test_tarball33',
    'test_tarball34',
    'test_tarball35',
    'test_tarball36',
]

@activity
def test_tarball27():
    test_tarball('2.7')

@activity
def test_tarball33():
    test_tarball('3.3')

@activity
def test_tarball34():
    test_tarball('3.4')

@activity
def test_tarball35():
    test_tarball('3.5')

@activity
def test_tarball36():
    test_tarball('3.6')


def test_tarball(py_version):
    """
    Test that the tarball can be unpacked and installed, and that sympy
    imports in the install.
    """
    if py_version not in {'2.7', '3.3', '3.4', '3.5', '3.6'}: # TODO: Add win32
        raise ValueError("release must be one of 2.7, 3.3, 3.4, 3.5, or 3.6 not %s" % py_version)


    with run_in_conda_env(['python=%s' % py_version], 'test-install-%s' % py_version):
        cp @('/vagrant/release/{source}'.format(**tarball_format)) @("releasetar.tar".format(**tarball_format))
        tar xvf releasetar.tar

        cd @("/home/vagrant/{source-orig-notar}".format(**tarball_format))
        python setup.py install
        python -c "import sympy; print(sympy.__version__)"'

BUG: version

rever 0.2.0 yields

Traceback (most recent call last):
  File "/home/christopher/mc/envs/dp_dev/bin/rever", line 3, in <module>
    main()
  File "/home/christopher/mc/envs/dp_dev/lib/python3.5/site-packages/rever/main.xsh", line 219, in main
    env_main(args=args)
  File "/home/christopher/mc/envs/dp_dev/lib/python3.5/site-packages/rever/main.xsh", line 213, in env_main
    run_activities(ns)
  File "/home/christopher/mc/envs/dp_dev/lib/python3.5/site-packages/rever/main.xsh", line 129, in run_activities
    need, done = compute_activities_to_run()
  File "/home/christopher/mc/envs/dp_dev/lib/python3.5/site-packages/rever/main.xsh", line 93, in compute_activities_to_run
    done = compute_activities_completed()
  File "/home/christopher/mc/envs/dp_dev/lib/python3.5/site-packages/rever/main.xsh", line 69, in compute_activities_completed
    entry['version'] == $VERSION):
KeyError: 'version'

Activities with only setup

Do we want activities which only have a setup?
Eg. setup doctr
The idea would be to maybe use rever to also do some project initialization?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.