Skip to content

Commit

Permalink
fix cli (#208)
Browse files Browse the repository at this point in the history
fix packaging for cli
  • Loading branch information
3nids authored Mar 6, 2023
1 parent 9fd6790 commit 4f421ae
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,19 @@ jobs:
cache: "pip"
cache-dependency-path: "requirements/*.txt"

- name: install
run: |
python -m pip install -U -r requirements/development.txt
python -m pip install -e .
- name: Simple cli test
run: qgis-plugin-ci --help

- name: Install system requirements
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev qttools5-dev-tools
- name: Install project requirements
run: |
python -m pip install -U -r requirements/base.txt
python -m pip install -U -r requirements/development.txt
- name: Tests
env:
tx_api_token: ${{ secrets.TRANSIFEX_TOKEN }}
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "setuptools-scm", "wheel", "setuptools-git-versioning"]
requires = ["setuptools>=61.0", "setuptools-scm", "wheel", "setuptools-git-versioning"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -31,20 +31,21 @@ classifiers = [
]

[project.scripts]
qgis-plugin-ci = "qgispluginci.cli:main"
qgis-plugin-ci = "qgispluginci.cli:cli"

[project.urls]
homepage = "https://opengisch.github.io/qgis-plugin-ci/"
documentation = "https://opengisch.github.io/qgis-plugin-ci/"
repository = "https://github.com/opengisch/qgis-plugin-ci/"
tracker = "https://github.com/opengisch/qgis-plugin-ci/issues"

[tool.setuptools.packages.find]
where = ["qgispluginci"]
[tool.setuptools]
py-modules = ["qgispluginci"]

[tool.setuptools-git-versioning]
enabled = true


[tool.setuptools.dynamic]
readme = {file = ["README.md"], content-type = "text/markdown"}
dependencies = {file = ["requirements/base.txt"]}
Expand Down
4 changes: 4 additions & 0 deletions qgispluginci/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from qgispluginci.cli import cli

if __name__ == "__main__":
cli()
8 changes: 2 additions & 6 deletions qgispluginci/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
from qgispluginci.release import release
from qgispluginci.translation import Translation

__version__ = version("qgispluginci")
__version__ = version("qgis-plugin-ci")
__title__ = "QGISPluginCI"


def main():
def cli():
# create the top-level parser
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter
Expand Down Expand Up @@ -246,7 +246,3 @@ def main():
t.push()

return exit_val


if __name__ == "__main__":
exit(main())

0 comments on commit 4f421ae

Please sign in to comment.