Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(make): improve local cleanup and installation #24

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@

cleanup:
rm -rf dist
pip uninstall gpt-pr --yes

requirements:
pipenv requirements > requirements.txt

install:
python setup.py install
install: cleanup requirements
python setup.py clean --all
pip install .

build: cleanup requirements
@echo "Building..."
Expand Down
7 changes: 6 additions & 1 deletion gptpr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
from gptpr.gitutil import get_branch_info
from gptpr.gh import create_pr
from gptpr.prdata import get_pr_data
from gptpr.version import __version__


def run(base_branch='main', yield_confirmation=False):
def run(base_branch='main', yield_confirmation=False, version=False):
'''
Create Pull Requests from current branch with base branch (default 'main' branch)
'''

if version:
print('Current version:', __version__)
return

branch_info = get_branch_info(base_branch, yield_confirmation)

if not branch_info:
Expand Down
3 changes: 3 additions & 0 deletions gptpr/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is generated automatically when package is released

__version__ = 'n/d'
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ def get_requirements():
raise Exception('VERSION environment variable not set')


def write_version(current_version):
with open('gptpr/version.py', 'w') as f:
f.write(f'__version__ = "{current_version}"\n')


write_version(version)

setup(name='gpt-pr',
version=version,
python_requires='>=3.7',
Expand Down
Loading