Skip to content

Commit

Permalink
No issue: Introduce subpackage cli, add more metadata to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
reckart committed Mar 19, 2024
1 parent 38d393b commit d77b6d3
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 8 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish to PyPi

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install poetry
make dependencies
# - name: Run tests
# run: |
# pytest
- name: Build package
run: |
make build
- name: Publish package to TestPyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docs:
poetry run mkdocs serve

# Building and publishing
build: unit-tests lint
build: lint # unit-tests lint
poetry build

publish: build
Expand Down
Empty file added inception/cli/__init__.py
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import click

from inception.utils import make_client, list_matching_projects, get_project_from_name, list_matching_zip_files
from inception.cli.utils import make_client, list_matching_projects, get_project_from_name, list_matching_zip_files


class FileIfNotRegex(click.ParamType):
Expand Down
4 changes: 2 additions & 2 deletions inception/cli.py → inception/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import click

from inception.commands import export_projects
from inception.commands.project import import_projects, delete_project, list_projects
from inception.cli.commands import export_projects
from inception.cli.commands.project import import_projects, delete_project, list_projects


@click.group(help="CLI tool for INCEpTION")
Expand Down
File renamed without changes.
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
[tool.poetry]
name = "inception-cli"
version = "0.1.0-dev"
readme = "README.md"
# homepage = "https://github.com/inception-project/inception-cli"
repository = "https://github.com/inception-project/inception-cli"
# documentation = "https://github.com/inception-project/inception-cli"
description = "INCEpTION command line tool"
authors = ["The INCEpTION Project"]
license = "Apache License 2.0"
authors = [ "The INCEpTION Project" ]
maintainers = [ "Richard Eckart de Castilho" ]
keywords = [ "INCEpTION" ]
license = "Apache-2.0"
packages = [
{ include = "inception" },
{ include = "inception/cli" },
]

[tool.poetry.dependencies]
Expand All @@ -32,7 +38,7 @@ line-length = 120
target_version = ['py38']

[tool.poetry.plugins."console_scripts"]
inception-cli = "inception.cli:cli"
inception-cli = "inception.cli.main:cli"

[build-system]
requires = ["poetry_core>=1.0.0"]
Expand Down

0 comments on commit d77b6d3

Please sign in to comment.