Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #24 from gijswobben/feature/enforce_rate_limit
Browse files Browse the repository at this point in the history
Feature/enforce rate limit
  • Loading branch information
gijswobben committed Jul 31, 2019
2 parents e377081 + 7086e13 commit 5bbce13
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Install package",
"type": "shell",
"command": "pip install -e ."
},
{
"label": "Publish package",
"type": "shell",
"command": "python build.py -u ${input:pypiUsername} -p ${input:pypiPassword}",
"problemMatcher": []
}
],
"inputs": [
{
"id": "pypiUsername",
"type": "promptString",
"description": "PyPi username for publishing the package"
},
{
"id": "pypiPassword",
"type": "promptString",
"description": "PyPi password for publishing the package"
}
]
}
12 changes: 7 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def clean():
raise e


def buildPackage(production=False):
def buildPackage(username, password, production=False):
""" Method that builds a package and uploads it to PyPi.
"""

Expand All @@ -30,9 +30,9 @@ def buildPackage(production=False):
# Run these OS commands to build and upload the package
os.system("python setup.py sdist bdist_wheel")
if production:
os.system("twine upload --repository pypiprd dist/*")
os.system(f"twine upload -u {username} -p {password} --repository pypiprd dist/*")
else:
os.system("twine upload --repository pypi dist/*")
os.system(f"twine upload -u {username} -p {password} --repository pypi dist/*")

# Clean any mess we made
clean()
Expand Down Expand Up @@ -79,11 +79,13 @@ def bumpVersion(release_type: str = "revision", direction: int = 1):


@click.command()
@click.option("--username", "-u", help="Username to publish to PyPi")
@click.option("--password", "-p", help="Password for publishing to PyPi")
@click.option(
"--release_type", "-t", default="revision", help="Type of release to build"
)
@click.option("--production/--no-production", default=False)
def build(release_type, production):
def build(release_type, username, password, production):
""" Method that chains together the bumping of the version, committing the change and pushing the new package.
"""

Expand All @@ -102,7 +104,7 @@ def build(release_type, production):
commitChanges()

print("Build the package and upload it to PyPi")
buildPackage(production=production)
buildPackage(username=username, password=password, production=production)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion pymed/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.8.7"
__version__ = "0.8.8"

0 comments on commit 5bbce13

Please sign in to comment.