Skip to content

Commit

Permalink
Fix package (#20)
Browse files Browse the repository at this point in the history
* Fix package

* update changelog
  • Loading branch information
inverse authored Mar 22, 2021
1 parent 2764cf6 commit ff8a807
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changelog

## 0.1.1
## 0.1.2

Initial release.
19 changes: 17 additions & 2 deletions autopr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@

from autopr import workdir, config, github, repo, database

__version__ = "0.1.1"
__version__ = "0.1.2"

from autopr.database import Repository

from autopr.util import CliException, set_debug, error
from autopr.util import CliException, set_debug, error, is_debug

WORKDIR: workdir.WorkDir


def main():
try:
cli(prog_name="auto-pr")
except CliException as e:
error(f"Error: {e}")
if is_debug():
raise e
else:
exit(1)


def _ensure_set_up(cfg: config.Config, db: database.Database):
if db.needs_pulling():
raise CliException("No data found. Please run 'pull' first.")
Expand Down Expand Up @@ -205,3 +216,7 @@ def reopen():
""" Reopen all un-merged pull requests """
_set_all_pull_requests_state(github.PullRequestState.OPEN)
click.secho("Finished reopening all closed unmerged pull requests")


if __name__ == "__main__":
main()
15 changes: 1 addition & 14 deletions autopr/__main__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
from autopr import cli
from autopr.util import CliException, is_debug, error


def main():
try:
cli(prog_name="auto-pr")
except CliException as e:
error(f"Error: {e}")
if is_debug():
raise e
else:
exit(1)

from autopr import main

if __name__ == "__main__":
main()

0 comments on commit ff8a807

Please sign in to comment.