From a58acd1bda1d37ab7798ddc3fa729b3a878cc1d5 Mon Sep 17 00:00:00 2001 From: Jeff Goeders Date: Mon, 12 Feb 2024 11:45:13 -0700 Subject: [PATCH] Fix versioning --- .github/Makefile | 1 + .github/print_version.py | 2 +- .github/workflows/package.yml | 26 ++++++++++++++++++++++++++ .github/workflows/python.yml | 4 ++-- .vscode/settings.json | 10 +++------- Makefile | 6 ++++-- requirements.txt | 3 +-- setup.py | 2 +- yinstruments/pdu/cli.py | 1 + yinstruments/pdu/pdu.py | 1 - 10 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/package.yml diff --git a/.github/Makefile b/.github/Makefile index fb164d8..2247dec 100644 --- a/.github/Makefile +++ b/.github/Makefile @@ -2,6 +2,7 @@ IN_ENV := . .venv/bin/activate; env: python3 -m venv .venv + $(IN_ENV) pip install packaging check_version_increase: $(IN_ENV) pip uninstall -y yinstruments diff --git a/.github/print_version.py b/.github/print_version.py index a32feb9..437aebf 100644 --- a/.github/print_version.py +++ b/.github/print_version.py @@ -1,4 +1,4 @@ import pkg_resources # part of setuptools -version = pkg_resources.require("yaccounts")[0].version +version = pkg_resources.require("yinstruments")[0].version print(version) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..ab69811 --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,26 @@ +name: Publish + +on: + push: + branches: + - main + +jobs: + package: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Environment + run: make env + + - name: Pypi credentials + run: | + echo "[pypi]" > ~/.pypirc + echo "username = __token__" >> ~/.pypirc + echo "password = ${{ secrets.PYPI_TOKEN }}" >> ~/.pypirc + + - name: Package + run: make package + \ No newline at end of file diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index f9830c2..52ce44a 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Get Diff Action @@ -51,7 +51,7 @@ jobs: - name: Install dependencies run: | python3 -m pip install --upgrade pip - pip3 install black + pip3 install -r requirements.txt - name: Run format run: | make format diff --git a/.vscode/settings.json b/.vscode/settings.json index c716d89..55bd5ea 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,8 @@ { - "python.pythonPath": "/usr/bin/python3", - "python.formatting.blackPath": "/home/nathanmain20/.local/lib/python3.8/site-packages", - "python.formatting.blackArgs": [ - "--line-length", - "100" - ], "[python]": { "editor.defaultFormatter": "ms-python.black-formatter" }, - "python.formatting.provider": "none" + "black-formatter.args": [ + "--line-length", "100" + ] } \ No newline at end of file diff --git a/Makefile b/Makefile index af71c89..3d076ea 100644 --- a/Makefile +++ b/Makefile @@ -18,10 +18,12 @@ format: pylint: pylint $$(git ls-files '*.py') -env: +env: .venv/bin/activate + +.venv/bin/activate: requirements.txt python3 -m venv .venv $(IN_ENV) pip install -r requirements.txt $(IN_ENV) pip install -e . -.PHONY: test doc \ No newline at end of file +.PHONY: test doc env format pylint \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index f2dbd52..7f42038 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -twine -black \ No newline at end of file +black==24.1.1 \ No newline at end of file diff --git a/setup.py b/setup.py index 206cd56..80bd455 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name="yinstruments", packages=find_packages(), - version="1.3.2", + version="1.3.3", description="Experiment device control scripts for BYU's Configurable Computing Lab (https://ccl.byu.edu/)", author="Jeff Goeders", author_email="jeff.goeders@gmail.com", diff --git a/yinstruments/pdu/cli.py b/yinstruments/pdu/cli.py index d3fa4c8..2465309 100644 --- a/yinstruments/pdu/cli.py +++ b/yinstruments/pdu/cli.py @@ -1,4 +1,5 @@ """This the file that will run to execute calls on your PDU""" + import argparse from .netbooter import Netbooter from .lindy import Lindy diff --git a/yinstruments/pdu/pdu.py b/yinstruments/pdu/pdu.py index fc80c4f..c08dce5 100644 --- a/yinstruments/pdu/pdu.py +++ b/yinstruments/pdu/pdu.py @@ -10,7 +10,6 @@ class PDUType(Enum): class PDU: - """Generic class for PDU""" # initializes your PDU with callable characteristics