From 31e63a092e32c8b2167d9a1a8e67a68664520a86 Mon Sep 17 00:00:00 2001 From: James Montgomery Date: Tue, 11 Feb 2025 12:32:56 -0800 Subject: [PATCH 1/3] Switched backend to hatchling --- .github/workflows/pytests.yml | 28 ----------------- .github/workflows/tests.yml | 58 +++++++++++++++++++++++++++++++++++ mlky/__init__.py | 2 +- pyproject.toml | 19 +++++------- 4 files changed, 67 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/pytests.yml create mode 100644 .github/workflows/tests.yml 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..418caa0 --- /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 twine + + - name: Build package + shell: bash + run: | + build --wheel + + - name: Install tarball + shell: bash + run: | + pip install dist/*.whl + + - 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" From 8e2f54a9529d15088fa6d0cf20c8d36ab57305c5 Mon Sep 17 00:00:00 2001 From: James Montgomery Date: Tue, 11 Feb 2025 12:35:44 -0800 Subject: [PATCH 2/3] Fixed commands for workflows --- .github/workflows/pypi.yml | 3 +-- .github/workflows/tests.yml | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 007a04b..db514d8 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -12,8 +12,7 @@ jobs: - name: Install dependencies shell: bash run: | - python -m pip install --upgrade pip - pip install build setuptools twine wheel + pip install --upgrade pip build twine - name: Build and publish shell: bash env: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 418caa0..9db3e69 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,17 +40,17 @@ jobs: - name: Install dependencies shell: bash run: | - pip install --upgrade pip build twine + pip install --upgrade pip build - name: Build package shell: bash run: | - build --wheel + python -m build --sdist --wheel - name: Install tarball shell: bash run: | - pip install dist/*.whl + pip install dist/*.gz - name: Test installation shell: bash From 16c2dcd710ac718554bf33332e78e39c7eb882b0 Mon Sep 17 00:00:00 2001 From: James Montgomery Date: Tue, 11 Feb 2025 12:38:45 -0800 Subject: [PATCH 3/3] Formatted pypi to be consistent with test case --- .github/workflows/pypi.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index db514d8..fc47b63 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -9,15 +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: | - pip install --upgrade pip build twine - - 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/*