Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
name: Publish Package to PyPI

on:
push:
paths:
- src/nisyscfg/VERSION
branches:
- main
release:
types:
- published

jobs:
build-and-publish:
if: github.repository == 'tkrebes/nisyscfg-python'
if: github.repository == 'ni/nisyscfg-python'
runs-on: ubuntu-latest

steps:
Expand All @@ -23,11 +18,11 @@ jobs:
with:
python-version: 3.9

- name: Install setuptools and other tools
run: python3 -m pip install setuptools wheel twine
- name: Set up Poetry
uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1

- name: Build packages
run: python3 setup.py bdist_wheel
run: poetry build

- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
Expand All @@ -37,7 +32,6 @@ jobs:
continue-on-error: true

- name: Publish distribution to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
password: ${{ secrets.pypi_password }}
14 changes: 6 additions & 8 deletions .github/workflows/test-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ jobs:
uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0
with:
python-version: ${{ matrix.python-version }}
- name: Install PIP
run: python -m pip install --upgrade pip
- name: Set up Poetry
uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1
- name: Install locked dependencies
run: poetry install -v
- name: Lint with flake8
run: |
pip install flake8
flake8
run: poetry run flake8
- name: Test with pytest
run: |
python -m pip install --editable . pytest pytest-cov
python -m pytest
run: poetry run pytest
6 changes: 3 additions & 3 deletions .github/workflows/test-wheel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
with:
python-version: 3.9

- name: Install setuptools and other tools
run: python3 -m pip install setuptools wheel twine
- name: Set up Poetry
uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1

- name: Build packages
run: python3 setup.py bdist_wheel
run: poetry build

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Install **nisyscfg** from PyPI:
pip install nisyscfg
```

Or, install **nisyscfg** by cloning the main branch and running the following command in the directory of setup.py:
Or, install **nisyscfg** by cloning the main branch and running the following command from the repository root:

```bash
pip install --pre .
Expand All @@ -53,4 +53,4 @@ with nisyscfg.Session() as session:
filter.is_device = True
for resource in session.find_hardware(filter):
print(resource.expert_user_alias[0])
```
```
422 changes: 422 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,68 @@
[project]
name = "nisyscfg"
version = "0.2.1"
description = "NI System Configuration Python API"
readme = "README.md"
requires-python = ">=3.9"
license = "MIT"
authors = [{ name = "National Instruments" }]
maintainers = [{ name = "Tyler Krehbiel", email = "tyler.krehbiel@emerson.com" }]
keywords = ["nisyscfg", "syscfg"]
dependencies = ["hightime", "six"]
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Developers",
"Intended Audience :: Manufacturing",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: System :: Hardware :: Hardware Drivers",
]

[project.urls]
repository = "https://github.com/ni/nisyscfg-python"
changelog = "https://github.com/ni/nisyscfg-python/blob/main/CHANGELOG.md"

[build-system]
requires = ["poetry-core>=2.1.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
requires-poetry = '>=2.1,<3.0'
packages = [{ include = "nisyscfg", from = "src" }]

[tool.poetry.group.test.dependencies]
pytest = ">=7.2"
pytest-cov = ">=4.0"

[tool.poetry.group.lint.dependencies]
flake8 = ">=7.0"
flake8-pyproject = ">=1.2.4"

[tool.pytest.ini_options]
addopts = "--cov=nisyscfg --cov-report=term --cov-report=xml --cov-report=html -svv --strict-markers"
testpaths = ["tests"]

[tool.flake8]
show_source = true
max_line_length = 120
exclude = ["build", "docs", "tests", ".tox", "__pycache__", ".venv*"]

# H404: Multi line docstrings should start without a leading new line.
# H405: Multi line docstrings should start with a one line summary followed by an empty line.
# H903: Windows style line endings not allowed in code
# E501: Line length
# W391: Blank line at end of file
# W503: Line break occurred before a binary operator (not PEP8 compatible)
# W504: Line break occurred after a binary operator (not PEP8 compatible)
ignore = ["H404", "H405", "H903", "E501", "W391", "W503", "W504"]
Comment thread
ni-jfitzger marked this conversation as resolved.

[tool.black]
line-length = 100
59 changes: 0 additions & 59 deletions setup.py

This file was deleted.

1 change: 0 additions & 1 deletion src/nisyscfg/VERSION

This file was deleted.

54 changes: 0 additions & 54 deletions tox.ini

This file was deleted.

Loading