diff --git a/.coverage b/.coverage new file mode 100644 index 0000000..4c4c9a8 Binary files /dev/null and b/.coverage differ diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..de5a4f9 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +ignore = E501, W503, F541, E203 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b483680..ff3bd4e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,18 +1,20 @@ # This is a basic workflow to help you get started with Actions -name: CI +name: Use hatch-version-action # Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + branches: [ "*" ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +env: + HATCH_INDEX_USER: __token__ + HATCH_INDEX_AUTH: ${{ secrets.pypi_token }} + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" @@ -24,12 +26,6 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - - - name: Setup Python - uses: actions/setup-python@v4.2.0 - with: - python-version: '3.10' - - - run: pip install hatch - - uses: waylonwalker/hatch-version-action@v1 + with: + beforeCommand: "test-lint" diff --git a/README.md b/README.md index 86c47dc..12ff265 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Hatch Version Action Example -[![PyPI - Version](https://img.shields.io/pypi/v/hatch-version-action-example.svg)](https://pypi.org/project/hatch-version-action-example) -[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hatch-version-action-example.svg)](https://pypi.org/project/hatch-version-action-example) ----- diff --git a/hatch_version_action_example/__about__.py b/hatch_version_action_example/__about__.py index fe60eb5..fc6a0bf 100644 --- a/hatch_version_action_example/__about__.py +++ b/hatch_version_action_example/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2022-present Waylon S. Walker # # SPDX-License-Identifier: MIT -__version__ = '0.0.1' +__version__ = "0.1.0.dev5" diff --git a/pyproject.toml b/pyproject.toml index 054c164..247e013 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,17 @@ classifiers = [ dependencies = [] dynamic = ["version"] +[project.optional-dependencies] +dev = [ + "black", + "isort", + "seed-isort-config", + "flake8", + "pytest", + "pytest-cov", + "pytest-mock", +] + [project.urls] Documentation = "https://github.com/unknown/hatch-version-action-example#readme" Issues = "https://github.com/unknown/hatch-version-action-example/issues" @@ -36,12 +47,27 @@ path = "hatch_version_action_example/__about__.py" [tool.hatch.envs.default] dependencies = [ - "pytest", - "pytest-cov", + "black", + "isort", + "seed-isort-config", + "flake8", + "pytest", + "pytest-cov", + "pytest-mock", ] [tool.hatch.envs.default.scripts] cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=hatch_version_action_example --cov=tests" no-cov = "cov --no-cov" +lint = "flake8 hatch_version_action_example" +format = "black --check hatch_version_action_example" +sort-imports = "isort hatch_version_action_example" +test-lint = [ + "lint", + "format", + "seed-isort-config", + "sort-imports", + "cov", +] [[tool.hatch.envs.test.matrix]] python = ["37", "38", "39", "310", "311"] @@ -59,3 +85,7 @@ exclude_lines = [ "if __name__ == .__main__.:", "if TYPE_CHECKING:", ] + +[tool.isort] +profile = "black" +known_third_party = [] diff --git a/tests/__init__.py b/tests/__init__.py index 8ecc75f..1e0fa64 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,3 +1,7 @@ # SPDX-FileCopyrightText: 2022-present Waylon S. Walker # # SPDX-License-Identifier: MIT + + +def test_me(): + assert True diff --git a/tests/__pycache__/__init__.cpython-310.pyc b/tests/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..0755541 Binary files /dev/null and b/tests/__pycache__/__init__.cpython-310.pyc differ diff --git a/tests/__pycache__/test_me.cpython-310-pytest-7.1.2.pyc b/tests/__pycache__/test_me.cpython-310-pytest-7.1.2.pyc new file mode 100644 index 0000000..a1ad162 Binary files /dev/null and b/tests/__pycache__/test_me.cpython-310-pytest-7.1.2.pyc differ diff --git a/tests/test_me.py b/tests/test_me.py new file mode 100644 index 0000000..7adb7d4 --- /dev/null +++ b/tests/test_me.py @@ -0,0 +1,2 @@ +def test_me(): + assert True