Skip to content

Commit 56c166f

Browse files
mikeprosserniMike Prosser
andauthored
Change pyproject.toml extras back to poetry dependencies (#144)
* change extras back to poetry dependencies * remove codegen dependencies * revert workflows * requires = ["poetry-core>=2.1.0"] * requires = ["poetry-core>=2.1.0,<3.0"] * use nps instead of ni-python-styleguide * fill out Getting Started --------- Co-authored-by: Mike Prosser <[email protected]>
1 parent 7ed53fa commit 56c166f

File tree

16 files changed

+302
-340
lines changed

16 files changed

+302
-340
lines changed

.github/workflows/check_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
path: .venv
2525
key: nipanel-with-docs-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
2626
- name: Install nipanel (with docs)
27-
run: poetry install -v --extras docs
27+
run: poetry install -v --only main,docs
2828
- name: Generate docs
2929
run: poetry run sphinx-build docs docs/_build -b html -W
3030
- name: Upload docs artifact

.github/workflows/check_nipanel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
path: .venv
2525
key: nipanel-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
2626
- name: Install nipanel
27-
run: poetry install -v --extras "dev docs examples lint test"
27+
run: poetry install -v --with examples,docs
2828
- name: Lint
2929
run: poetry run ni-python-styleguide lint
3030
- name: Mypy static analysis (Linux)

.github/workflows/run_unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
path: .venv
3232
key: nipanel-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
3333
- name: Install nipanel
34-
run: poetry install -v --extras test
34+
run: poetry install -v
3535
- name: Run unit tests and code coverage
3636
run: poetry run pytest ./tests/unit -v --cov=nipanel --junitxml=test_results/nipanel-${{ matrix.os }}-py${{ matrix.python-version }}.xml
3737
- name: Upload test results

CONTRIBUTING.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ See [GitHub's official documentation](https://help.github.com/articles/using-pul
2121

2222
# Getting Started
2323

24+
To contribute to this project, it is recommended that you follow these steps:
25+
26+
1. Ensure you have poetry installed
27+
1. Fork the repository on GitHub.
28+
1. Install `nipanel` dependencies using `poetry install`
29+
1. Run the regression tests on your system (see Testing section). At this point, if any tests fail, do not begin development. Try to investigate these failures. If you're unable to do so, report an issue through our [GitHub issues page](https://github.com/ni/nipanel-python/issues).
30+
1. Write new tests that demonstrate your bug or feature. Ensure that these new tests fail.
31+
1. Make your change.
32+
1. Run all the regression tests again (including the tests you just added), and confirm that they all pass.
33+
1. Run `poetry run nps lint` to check that the updated code follows NI's Python coding conventions. If this reports errors, first run `poetry run nps fix` in order to sort imports and format the code with Black, then manually fix any remaining errors.
34+
1. Run `poetry run mypy` to statically type-check the updated code.
35+
1. Send a GitHub Pull Request to the main repository's main branch. GitHub Pull Requests are the expected method of code collaboration on this project.
36+
2437
# Testing
2538

2639
## Simple development loop
@@ -31,17 +44,17 @@ git fetch
3144
git switch --create users/{username}/{branch-purpose} origin/main
3245
3346
# Install the project dependencies
34-
poetry install --extras docs
47+
poetry install --with docs
3548
3649
# ✍ Make source changes
3750
3851
# Run the analyzers -- see files in .github/workflows for details
39-
poetry run ni-python-styleguide lint
52+
poetry run nps lint
4053
poetry run mypy
4154
poetry run bandit -c pyproject.toml -r src/nipanel
4255
4356
# Apply safe fixes
44-
poetry run ni-python-styleguide fix
57+
poetry run nps fix
4558
4659
# Run the tests
4760
poetry run pytest -v
@@ -54,7 +67,7 @@ start docs\_build\index.html
5467
## Running examples
5568

5669
1. Run the **PythonPanelService** (not part of this repo, provided seperately)
57-
2. `poetry install --extras examples` to get the dependencies needed for the examples
70+
2. `poetry install --with examples` to get the dependencies needed for the examples
5871
3. Run the examples with these command(s):
5972
- `poetry run python examples/hello/hello.py`
6073
- `poetry run python examples/all_types/all_types.py`

examples/all_types/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ This is an example for `nipanel` that demonstrates all supported data types.
1313
### Usage
1414

1515
```pwsh
16-
poetry install --extras examples
16+
poetry install --with examples
1717
poetry run python examples/all_types/all_types.py
1818
```

examples/hello/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ This is a simple `nipanel` example that displays a Streamlit app.
1313
### Usage
1414

1515
```pwsh
16-
poetry install --extras examples
16+
poetry install --with examples
1717
poetry run python examples/hello/hello.py
1818
```

examples/nidaqmx/nidaqmx_analog_input_filtering/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Script demonstrates analog input data getting continuously acquired, and being f
1717
### Usage
1818

1919
```pwsh
20-
poetry install --extras examples
20+
poetry install --with examples
2121
poetry run python examples\nidaqmx\nidaqmx_analog_input_filtering\nidaqmx_analog_input_filtering.py
2222
```
2323

examples/nidaqmx/nidaqmx_analog_output_voltage/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ This is a nipanel example that displays an interactive Streamlit app and updates
1717
### Usage
1818

1919
```pwsh
20-
poetry install --extras examples
20+
poetry install --with examples
2121
poetry run examples\nidaqmx\nidaqmx_analog_output_voltage\nidaqmx_analog_output_voltage.py
2222
```

examples/nidaqmx/nidaqmx_continuous_analog_input/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ This is a nipanel example that displays an interactive Streamlit app and updates
1717
### Usage
1818

1919
```pwsh
20-
poetry install --extras examples
20+
poetry install --with examples
2121
poetry run examples\nidaqmx\nidaqmx_continuous_analog_input\nidaqmx_continuous_analog_input.py
2222
```

examples/niscope/nicope_ex_fetch_forever/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ Script demonstrates NIScope waveform data getting continuously acquired.
1818
### Usage
1919

2020
```pwsh
21-
poetry install --extras examples
21+
poetry install --with examples
2222
poetry run examples\niscope\niscope_ex_fetch_forever\niscope_ex_fetch_forever.py
2323
```

0 commit comments

Comments
 (0)