Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
fordnox committed Dec 7, 2023
1 parent a666e67 commit 3898347
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 5 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy

on:
release:
types: [ published ]

defaults:
run:
shell: bash

jobs:
deploy-pypi:
name: Deploy to PyPI
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/setup
with:
python-version: "3.10"
venv-id: "deploy"
poetry-dependency-install-flags: "--all-extras"
- name: Run tests
run: |
poetry run pytest
- name: Publish to PyPI
env:
PYPI_TOKEN: "${{ secrets.PYPI_TOKEN }}"
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build --no-interaction
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ install:
poetry install --with test,dev

example:
poetry run python -m wordplex "Porsche-99#"
poetry run python -m wordplex -f "Porsche-99#"

lint:
poetry run black .
Expand Down
23 changes: 19 additions & 4 deletions wordplex/__main__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
import sys

import argparse
from .wordplex import WordPlex

_format = sys.argv[1]
parser = argparse.ArgumentParser()

parser.add_argument("-s", "--suffix", dest="suffix", default="", help="Suffix")
parser.add_argument("-p", "--prefix", dest="prefix", default="", help="Prefix")
parser.add_argument("-f", "--format", dest="format", default=None, help="Format to use")
parser.add_argument("-w", "--word", dest="word", default=None, help="Generate similar to provided word")

config = parser.parse_args()

wp = WordPlex()
wp.set_format(_format)
wp.set_prefix(config.prefix)
wp.set_suffix(config.suffix)

if config.format is not None:
wp.set_format(config.format)

if config.word:
wp.set_format_by_word(config.word)

wp.go(print)

0 comments on commit 3898347

Please sign in to comment.