GithubHelp home page GithubHelp logo

mobiusbyte / bumpit Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 142 KB

A small command line tool to bump tracked versions in your repository.

Home Page: https://pypi.org/project/bumpit/

License: MIT License

Python 100.00%
bumpit calver mit-license semver

bumpit's People

Contributors

iamjillsanluis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wooseung-sim

bumpit's Issues

Handle absecnce of .bumpit.yaml with clean error

Describe the bug
Bumpit when invoked without the .bumpit.yaml file gives a file not found error.

To Reproduce
Steps to reproduce the behavior:

  1. pip install bumpit
  2. bumpit -d

Expected behavior
No error, just help text saying file is missing.

Additional context

Traceback (most recent call last):
  File "/home/jose/.virtualenvs/build_tools/bin/bumpit", line 8, in <module>
    sys.exit(main())
  File "/home/jose/.virtualenvs/build_tools/lib/python3.7/site-packages/bumpit/console/cli.py", line 48, in main
    bumpit()  # pragma: no cover
  File "/home/jose/.virtualenvs/build_tools/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/jose/.virtualenvs/build_tools/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/jose/.virtualenvs/build_tools/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jose/.virtualenvs/build_tools/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/jose/.virtualenvs/build_tools/lib/python3.7/site-packages/bumpit/console/cli.py", line 26, in bumpit
    configuration = Configuration.parse(config)
  File "/home/jose/.virtualenvs/build_tools/lib/python3.7/site-packages/bumpit/core/config.py", line 15, in parse
    with open(file, "rb") as fh:
FileNotFoundError: [Errno 2] No such file or directory: '.bumpit.yaml'

Allow users to import bumpit as a library

An app developer should be able to use bumpit as a library instead of just using the CLI.

  • Extract core bumpit logic outside the cli module
  • Document the new entry point

Consider using pygit2 for Git interface

Is your feature request related to a problem? Please describe.
Possibly, when used with a brand new jenkins machine git config --user.* is not setup correctly.
Pygit2 provides a cleaner interface to running git commands.

Describe the solution you'd like
bumpit.yaml

user:
  name: username
  email: [email protected]

Code sample:

import pygit2 
tagger = pygit2.Signature('Bumpit Bot', '[email protected]')
repo.create_tag(name="version", repo.head.tatget.hex ,pygit2.GIT_OBJ_BLOB, tagger, "Next release")

References:
https://github.com/libgit2/pygit2/blob/5b015f7008c4c3079d72e948669bcd3964c00633/test/test_tag.py#L58

Edits
Added more details to examples and code sample in pygit2

Properly implement calver

Current calver implementation is super naive. We need to support different token formats of CalVer.

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.