diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 007a04b..fc47b63 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -9,16 +9,26 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install dependencies shell: bash run: | - python -m pip install --upgrade pip - pip install build setuptools twine wheel - - name: Build and publish + pip install --upgrade pip build + + - name: Build package + shell: bash + run: | + python -m build --sdist --wheel + + - name: Publish shell: bash env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - python -m build --sdist --wheel twine upload dist/* diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml deleted file mode 100644 index 69289f7..0000000 --- a/.github/workflows/pytests.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Pytest - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 - with: - python-version: "3.10" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest - pip install . - - name: Test with pytest - run: | - pytest diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..9db3e69 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,58 @@ +name: Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + pytest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + pip install . + - name: Test with pytest + run: | + pytest + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + shell: bash + run: | + pip install --upgrade pip build + + - name: Build package + shell: bash + run: | + python -m build --sdist --wheel + + - name: Install tarball + shell: bash + run: | + pip install dist/*.gz + + - name: Test installation + shell: bash + run: | + mlky --version diff --git a/mlky/__init__.py b/mlky/__init__.py index bc8165b..e0fa4de 100644 --- a/mlky/__init__.py +++ b/mlky/__init__.py @@ -2,7 +2,7 @@ """ import importlib.metadata -__version__ = importlib.metadata.version("mlky") +__version__ = "4.2.5" # Instantiate before the CLI from .configs import * diff --git a/pyproject.toml b/pyproject.toml index 49c4fe8..2fd7760 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,6 @@ -[build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" - -[tool.setuptools] -license-files = [] - -[tool.setuptools.packages.find] -include = ["mlky"] - [project] name = "mlky" -version = "4.2.4" +dynamic = ["version"] description = "Flexible Configurations: Because it's the only Way" readme = "README.md" requires-python = ">=3.9" @@ -48,3 +38,10 @@ documentation = "https://jammont.github.io/mlky/" [project.scripts] mlky = "mlky:cli.cli.commands" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.version] +path = "mlky/__init__.py"