From 88f367582366ae13891df529da18811788297be9 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:00:46 -0500 Subject: [PATCH 01/83] add template public release approval form --- GitHubRepoPublicReleaseApproval.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 GitHubRepoPublicReleaseApproval.md diff --git a/GitHubRepoPublicReleaseApproval.md b/GitHubRepoPublicReleaseApproval.md new file mode 100644 index 0000000..ff4fc4a --- /dev/null +++ b/GitHubRepoPublicReleaseApproval.md @@ -0,0 +1,23 @@ +# GitHub Repository Public Release Approval + +**Project Name:** Office of Spectrum Management R&D - Propagation Library + +**Software Name:** TODO-TEMPLATE + +The software identified above, which is contained within the repository this document is stored in, has met the following criteria for public release: + +1. [ ] The project, including the test criteria, meets the requirements defined in the ITS Software Development Publication Policy for making a repository public. The major pre-established criteria for publication are listed below, and the check mark next to each attests that the criterion has been met. + * [ ] Unit tests are available and the software has been tested against the unit tests + * [ ] Any test data necessary for the code and its unit tests to function is included in this GitHub repository, or in a parent repository which includes this one as a Git submodule. + * [ ] This repository contains complete README and CONTRIBUTING files +1. [ ] This repository adheres to the PropLib Template, and is up-to-date with the latest tagged release of the template repository. +1. [ ] All template or placeholder code has been removed +1. [ ] The README.md file has passed editorial review from the ITS Publications Office. +1. [ ] The project complies with the ITS Code Style Guide or an appropriate style guide as agreed to by the sponsor, project lead, or Supervising Division Chief. +1. [ ] Approved disclaimer and licensing language has been included. + +In order to complete this approval, please create a new branch, upload and commit your version of this Markdown document to that branch, then create a pull request for that branch. The following must login to GitHub and approve that pull request before the pull request can be merged and this repo made public: + +* **Project Lead:** TODO-TEMPLATE + +* **Supervising Division Chief or Release Authority:** TODO-TEMPLATE From a13ae565d6a5844d3c5c9dbd6218aaf4f8035ab4 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:06:57 -0500 Subject: [PATCH 02/83] Update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d1ebe2..cb960d7 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ This code repository is a template repository for Python wrappers in the NTIA/ITS Propagation Library (PropLib). This template is intended for developers wishing to develop a cross-platform Python interface to a compiled C++ library as part of -PropLib. Instructions on how to use this repository are found in its -[GitHub Wiki](https://github.com/NTIA/proplib-template-python/wiki). +PropLib. Instructions on how to use this repository are found in the +[PropLib Template Wiki](https://github.com/NTIA/proplib-template/wiki). Additional template repositories exist for building the C++ base repository and the C#/.NET and MATLAB wrappers. See: From f704e6e84f82b3a0067eae5e9591467684a357ed Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:23:35 -0500 Subject: [PATCH 03/83] Add template public release form --- GitHubRepoPublicReleaseApproval.md | 39 ++++++++++++++++++------------ 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/GitHubRepoPublicReleaseApproval.md b/GitHubRepoPublicReleaseApproval.md index ff4fc4a..ad5714a 100644 --- a/GitHubRepoPublicReleaseApproval.md +++ b/GitHubRepoPublicReleaseApproval.md @@ -1,23 +1,32 @@ # GitHub Repository Public Release Approval -**Project Name:** Office of Spectrum Management R&D - Propagation Library +**Project Name:** NTIA/OSM Research and Development **Software Name:** TODO-TEMPLATE -The software identified above, which is contained within the repository this document is stored in, has met the following criteria for public release: +The project identified above, which is contained within the repository this +document is stored in, has met the following criteria for public release: -1. [ ] The project, including the test criteria, meets the requirements defined in the ITS Software Development Publication Policy for making a repository public. The major pre-established criteria for publication are listed below, and the check mark next to each attests that the criterion has been met. - * [ ] Unit tests are available and the software has been tested against the unit tests - * [ ] Any test data necessary for the code and its unit tests to function is included in this GitHub repository, or in a parent repository which includes this one as a Git submodule. - * [ ] This repository contains complete README and CONTRIBUTING files -1. [ ] This repository adheres to the PropLib Template, and is up-to-date with the latest tagged release of the template repository. -1. [ ] All template or placeholder code has been removed -1. [ ] The README.md file has passed editorial review from the ITS Publications Office. -1. [ ] The project complies with the ITS Code Style Guide or an appropriate style guide as agreed to by the sponsor, project lead, or Supervising Division Chief. -1. [ ] Approved disclaimer and licensing language has been included. +1. [ ] The project, including the test criteria, meets the requirements defined +in the ITS Software Development Publication Policy for making a repository public. +The major pre-established criteria for publication are listed below, and the check +mark next to each attests that the criterion has been met. + * [ ] Unit tests are available and the software has been tested against the unit tests. + * [ ] The software can be compiled and/or used on Windows, macOS, and Linux. + * [ ] The repository structure and contents follow from the ITS PropLib template, and + all template or placeholder code has been removed. + * [ ] The repository includes the appropriate `LICENSE.md` file +2. [ ] Any test data necessary for the code and its unit tests to function is included in this +GitHub repository, or in a parent repository which includes this one as a Git submodule. +3. [ ] The README.md file has passed editorial review from the ITS Publications Office. +4. [ ] The project complies with the ITS Code Style Guide or an appropriate style +guide as agreed to by the sponsor, project lead, or Supervising Division Chief. +5. [ ] Approved disclaimer and licensing language has been included. -In order to complete this approval, please create a new branch, upload and commit your version of this Markdown document to that branch, then create a pull request for that branch. The following must login to GitHub and approve that pull request before the pull request can be merged and this repo made public: +In order to complete this approval, please create a new branch, upload and commit +your version of this Markdown document to that branch, then create a pull request +for that branch. The following must login to GitHub and approve that pull request +before the pull request can be merged and this repo made public: -* **Project Lead:** TODO-TEMPLATE - -* **Supervising Division Chief or Release Authority:** TODO-TEMPLATE +* Project Lead: TODO-TEMPLATE +* Supervising Division Chief or Release Authority: TODO-TEMPLATE From 9fda6d40be3f74c8ac95a60aa20e18f478697e37 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:27:41 -0500 Subject: [PATCH 04/83] Create GitHubRepoPublicReleaseApproval.md --- GitHubRepoPublicReleaseApproval.md | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 GitHubRepoPublicReleaseApproval.md diff --git a/GitHubRepoPublicReleaseApproval.md b/GitHubRepoPublicReleaseApproval.md new file mode 100644 index 0000000..1aa152e --- /dev/null +++ b/GitHubRepoPublicReleaseApproval.md @@ -0,0 +1,32 @@ +# GitHub Repository Public Release Approval + +**Project Name:** NTIA/OSM Research and Development + +**Software Name:** Recommendation ITU-R P.2108, Python Wrapper + +The project identified above, which is contained within the repository this +document is stored in, has met the following criteria for public release: + +1. [x] The project, including the test criteria, meets the requirements defined +in the ITS Software Development Publication Policy for making a repository public. +The major pre-established criteria for publication are listed below, and the check +mark next to each attests that the criterion has been met. + * [x] Unit tests are available and the software has been tested against the unit tests. + * [x] The software can be compiled and/or used on Windows, macOS, and Linux. + * [x] The repository structure and contents follow from the ITS PropLib template, and + all template or placeholder code has been removed. + * [x] The repository includes the appropriate `LICENSE.md` file +2. [x] Any test data necessary for the code and its unit tests to function is included in this +GitHub repository, or in a parent repository which includes this one as a Git submodule. +3. [x] The README.md file has passed editorial review from the ITS Publications Office. +4. [x] The project complies with the ITS Code Style Guide or an appropriate style +guide as agreed to by the sponsor, project lead, or Supervising Division Chief. +5. [x] Approved disclaimer and licensing language has been included. + +In order to complete this approval, please create a new branch, upload and commit +your version of this Markdown document to that branch, then create a pull request +for that branch. The following must login to GitHub and approve that pull request +before the pull request can be merged and this repo made public: + +* Project Lead: Brian Lain +* Supervising Division Chief or Release Authority: Chris Anderson From 830cf7d31e3231fbf2c4c986f152ee25f67414e6 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:50:35 -0500 Subject: [PATCH 05/83] Update citation metadata and remove zenodo file --- .zenodo.json | 17 ----------------- CITATION.cff | 28 +++++----------------------- 2 files changed, 5 insertions(+), 40 deletions(-) delete mode 100644 .zenodo.json diff --git a/.zenodo.json b/.zenodo.json deleted file mode 100644 index 4f32142..0000000 --- a/.zenodo.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "creators": [ - { - "orcid": "TODO-TEMPLATE", - "affiliation": "U.S. Department of Commerce, National Telecommunications and Information Administration, Institute for Telecommunication Sciences", - "name": "TODO-TEMPLATE" - } - ], - "license": "NTIA Public Domain", - "title": "TODO-TEMPLATE, Python Wrapper", - "upload_type": "software", - "version": "TODO-TEMPLATE", - "keywords": ["TODO-TEMPLATE"], - "communities": [ - {"identifier": "its-proplib"} - ] -} diff --git a/CITATION.cff b/CITATION.cff index ab4ac49..3abbe42 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,19 +1,9 @@ cff-version: 1.2.0 title: >- - Recommendation ITU-R P.2108-1, U.S. Reference Python - Implementation + Recommendation ITU-R P.2108, Python Wrapper message: Please cite this software using these metadata. type: software authors: - - given-names: William - family-names: Kozma - name-suffix: Jr - email: wkozma@ntia.gov - affiliation: >- - U.S. Department of Commerce, National - Telecommunications and Information Administration, - Institute for Telecommunication Sciences - orcid: 'https://orcid.org/0000-0002-7417-4009' - given-names: Anthony family-names: Romaniello name-particle: W. @@ -26,27 +16,19 @@ authors: - name: >- U.S. Department of Commerce, National Telecommunications and Information Administration, - Institute for Telecommunications Sciences + Institute for Telecommunication Sciences address: 325 Broadway city: Boulder - country: US + country: CO post-code: '80305' - region: Colorado + alias: NTIA/ITS email: code@ntia.gov website: 'https://its.ntia.gov' - alias: NTIA/ITS -identifiers: - - type: doi - value: 10.5281/zenodo.7114523 - description: TODO PLACEHOLDER how was doi generated, doi given is wrong. repository-code: 'https://github.com/NTIA/p2108-python' -url: 'https://github.com/NTIA/propagation/wiki' -repository: 'https://github.com/NTIA/p2108' +url: 'https://ntia.github.io/propagation-library-wiki/models/P2108/' keywords: - propagation - rf - clutter - itu -license: 'NTIA Public Domain' version: 1.0.0 -date-released: '2024-05-24' From a2f0c26b4077e1d96f1c63697e476190b43230c7 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:50:52 -0500 Subject: [PATCH 06/83] Update README in preparation of publication --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 80abe70..d31a5d8 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,18 @@ # Recommendation ITU-R P.2108 - U.S. Reference Implementation, Python # [![NTIA/ITS PropLib][proplib-badge]][proplib-link] -[![GitHub Release][gh-releases-badge]][gh-releases-link] [![GitHub Issues][gh-issues-badge]][gh-issues-link] + + [proplib-badge]: https://img.shields.io/badge/PropLib-badge?label=%F0%9F%87%BA%F0%9F%87%B8%20NTIA%2FITS&labelColor=162E51&color=D63E04 [proplib-link]: https://ntia.github.io/propagation-library-wiki - - -[gh-releases-badge]: https://img.shields.io/github/v/release/NTIA/p2108-python?logo=github&label=Release&labelColor=162E51&color=D63E04 -[gh-releases-link]: https://github.com/NTIA/p2108-python/releases +[gh-actions-test-badge]: https://img.shields.io/github/actions/workflow/status/NTIA/p2108-python/tox.yml?branch=main&logo=pytest&logoColor=ffffff&label=Tests&labelColor=162E51 +[gh-actions-test-link]: https://github.com/NTIA/p2108-python/actions/workflows/tox.yml +[pypi-release-badge]: https://img.shields.io/pypi/v/proplib-p2108?logo=pypi&logoColor=ffffff&label=Release&labelColor=162E51&color=D63E04 +[pypi-release-link]: https://pypi.org/project/proplib-p2108 [gh-issues-badge]: https://img.shields.io/github/issues/NTIA/p2108-python?logo=github&label=Issues&labelColor=162E51 [gh-issues-link]: https://github.com/NTIA/p2108-python/issues - - Python® wrapper for U.S. Reference Software Implementation of Recommendation ITU-R P.2108. This Recommendation contains three methods for the prediction of clutter @@ -24,7 +23,11 @@ the Recommendation. This Python package wraps the ## Getting Started ## -This software is distributed on [PyPi](https://pypi.org/project/p2108) and is easily installable +> [!NOTE] +> The text below indicates this package is distributed on PyPi, +> however it is not yet uploaded. A link will be provided here when available. + +This software is distributed on [PyPI](#) and is easily installable using the following command. ```cmd From f4657411675cc1f3c44c1afa52170bb42d34a5cc Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:51:20 -0500 Subject: [PATCH 07/83] Remove zenodo file --- .zenodo.json | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .zenodo.json diff --git a/.zenodo.json b/.zenodo.json deleted file mode 100644 index 4f32142..0000000 --- a/.zenodo.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "creators": [ - { - "orcid": "TODO-TEMPLATE", - "affiliation": "U.S. Department of Commerce, National Telecommunications and Information Administration, Institute for Telecommunication Sciences", - "name": "TODO-TEMPLATE" - } - ], - "license": "NTIA Public Domain", - "title": "TODO-TEMPLATE, Python Wrapper", - "upload_type": "software", - "version": "TODO-TEMPLATE", - "keywords": ["TODO-TEMPLATE"], - "communities": [ - {"identifier": "its-proplib"} - ] -} From 4fd223171eee19192a366edda726d0ad283e76dd Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:52:36 -0500 Subject: [PATCH 08/83] Add template citation file --- CITATION.cff | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 CITATION.cff diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..b30ea19 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,32 @@ +cff-version: 1.2.0 +title: >- + TODO-TEMPLATE, Python Wrapper +message: Please cite this software using these metadata. +type: software +authors: + - given-names: TODO-TEMPLATE + family-names: TODO-TEMPLATE + name-particle: TODO-TEMPLATE (optional) + email: TODO-TEMPLATE@ntia.gov + affiliation: >- + U.S. Department of Commerce, National + Telecommunications and Information Administration, + Institute for Telecommunication Sciences + orcid: 'https://orcid.org/TODO-TEMPLATE' + - name: >- + U.S. Department of Commerce, National + Telecommunications and Information Administration, + Institute for Telecommunication Sciences + address: 325 Broadway + city: Boulder + country: CO + post-code: '80305' + alias: NTIA/ITS + email: code@ntia.gov + website: 'https://its.ntia.gov' +repository-code: 'https://github.com/NTIA/TODO-TEMPLATE' +url: 'https://ntia.github.io/propagation-library-wiki/models/TODO-TEMPLATE/' +keywords: + - propagation + - TODO-TEMPLATE +version: 1.0.0 From cf69743d33b0ae403e4d433180fc8364f29c1e0e Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:53:14 -0500 Subject: [PATCH 09/83] Remove DOI badge, replace github release with PyPI badge, add disclaimer --- README.md | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index cb960d7..393e579 100644 --- a/README.md +++ b/README.md @@ -3,40 +3,31 @@ [![NTIA/ITS PropLib][proplib-badge]][proplib-link] [proplib-badge]: https://img.shields.io/badge/PropLib-badge?label=%F0%9F%87%BA%F0%9F%87%B8%20NTIA%2FITS&labelColor=162E51&color=D63E04 [proplib-link]: https://ntia.github.io/propagation-library-wiki -[gh-actions-test-badge]: https://img.shields.io/github/actions/workflow/status/NTIA/TODO-TEMPLATE/tox.yml?branch=main&logo=pytest&logoColor=ffffff&label=Build%2FTests&labelColor=162E51 +[gh-actions-test-badge]: https://img.shields.io/github/actions/workflow/status/NTIA/TODO-TEMPLATE/tox.yml?branch=main&logo=pytest&logoColor=ffffff&label=Tests&labelColor=162E51 [gh-actions-test-link]: https://github.com/NTIA/TODO-TEMPLATE/actions/workflows/tox.yml -[gh-releases-badge]: https://img.shields.io/github/v/release/NTIA/TODO-TEMPLATE?logo=github&label=Release&labelColor=162E51&color=D63E04 -[gh-releases-link]: https://github.com/NTIA/TODO-TEMPLATE/releases +[pypi-release-badge]: https://img.shields.io/pypi/v/TODO-TEMPLATE?logo=pypi&logoColor=ffffff&label=Release&labelColor=162E51&color=D63E04 +[pypi-release-link]: https://pypi.org/project/TODO-TEMPLATE [gh-issues-badge]: https://img.shields.io/github/issues/NTIA/TODO-TEMPLATE?logo=github&label=Issues&labelColor=162E51 [gh-issues-link]: https://github.com/NTIA/TODO-TEMPLATE/issues -[doi-badge]: https://img.shields.io/badge/{TODO-TEMPLATE-ALL-VERSIONS-DOI}-x?logo=doi&logoColor=ffffff&labelColor=162E51&color=D63E04 -[doi-link]: https://zenodo.org/badge/latestdoi/{TODO-TEMPLATE-REPOSITORY-ID} This code repository is a template repository for Python wrappers in the NTIA/ITS @@ -62,7 +53,11 @@ For questions about using this template repository, contact [!NOTE] +> The text below indicates this package is distributed on PyPi, +> however it is not yet uploaded. A link will be provided here when available. + +This software is distributed on [PyPi](#) and is easily installable using the following command. ```cmd From 47f6ca766556bc6c99a28dab7266eeb25881cc21 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:57:27 -0500 Subject: [PATCH 10/83] Fix capitalization --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 393e579..3ddf94b 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ TODO-TEMPLATE: Update links in this section > The text below indicates this package is distributed on PyPi, > however it is not yet uploaded. A link will be provided here when available. -This software is distributed on [PyPi](#) and is easily installable +This software is distributed on [PyPI](#) and is easily installable using the following command. ```cmd From 46aee01e0f4f96f28a228b5553a017f660b6f656 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:53:05 -0500 Subject: [PATCH 11/83] Create cff-validator.yml --- .github/workflows/cff-validator.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/cff-validator.yml diff --git a/.github/workflows/cff-validator.yml b/.github/workflows/cff-validator.yml new file mode 100644 index 0000000..dc7d4d8 --- /dev/null +++ b/.github/workflows/cff-validator.yml @@ -0,0 +1,21 @@ +name: Validate CITATION.cff + +on: + push: + paths: CITATION.cff + pull_request: + paths: CITATION.cff + workflow_dispatch: + +jobs: + Validate-CITATION-cff: + runs-on: ubuntu-latest + name: Validate CITATION.cff + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Validate CITATION.cff + uses: dieghernan/cff-validator@v3 From e452154c627f4c54ff7ccb0f0c32f355dcfcb47e Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:58:12 -0500 Subject: [PATCH 12/83] Remove name-particle from template citation file --- CITATION.cff | 1 - 1 file changed, 1 deletion(-) diff --git a/CITATION.cff b/CITATION.cff index b30ea19..94b34d8 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -6,7 +6,6 @@ type: software authors: - given-names: TODO-TEMPLATE family-names: TODO-TEMPLATE - name-particle: TODO-TEMPLATE (optional) email: TODO-TEMPLATE@ntia.gov affiliation: >- U.S. Department of Commerce, National From 9ab2e063a6fa6b3dc4dc5b8909c0d9fa51f663bb Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:59:54 -0500 Subject: [PATCH 13/83] Fix name in citation file --- CITATION.cff | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 3abbe42..4b630d3 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -4,9 +4,8 @@ title: >- message: Please cite this software using these metadata. type: software authors: - - given-names: Anthony + - given-names: Anthony W. family-names: Romaniello - name-particle: W. email: aromaniello@ntia.gov affiliation: >- U.S. Department of Commerce, National From 72f771243df53bd3e2b740d8388139a02e94ddcd Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:11:23 -0500 Subject: [PATCH 14/83] Make template valid --- CITATION.cff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CITATION.cff b/CITATION.cff index 94b34d8..98a9812 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -11,7 +11,7 @@ authors: U.S. Department of Commerce, National Telecommunications and Information Administration, Institute for Telecommunication Sciences - orcid: 'https://orcid.org/TODO-TEMPLATE' + orcid: 'https://orcid.org/0000-0000-0000-0000' - name: >- U.S. Department of Commerce, National Telecommunications and Information Administration, From af0d8b5c4f5c2f3af1953f3acd9cddca4cff20b5 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:33:59 -0500 Subject: [PATCH 15/83] Fix file filter in CFF validator --- .github/workflows/cff-validator.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cff-validator.yml b/.github/workflows/cff-validator.yml index dc7d4d8..a01dee3 100644 --- a/.github/workflows/cff-validator.yml +++ b/.github/workflows/cff-validator.yml @@ -2,9 +2,13 @@ name: Validate CITATION.cff on: push: - paths: CITATION.cff + paths: + - CITATION.cff + - .github/workflows/cff-validator.yml pull_request: - paths: CITATION.cff + paths: + - CITATION.cff + - .github/workflows/cff-validator.yml workflow_dispatch: jobs: From e5a222b7b2393ef545ab345cfda4c8bf766632f3 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:29:14 -0500 Subject: [PATCH 16/83] Delete GitHubRepoPublicReleaseApproval.md --- GitHubRepoPublicReleaseApproval.md | 32 ------------------------------ 1 file changed, 32 deletions(-) delete mode 100644 GitHubRepoPublicReleaseApproval.md diff --git a/GitHubRepoPublicReleaseApproval.md b/GitHubRepoPublicReleaseApproval.md deleted file mode 100644 index 1aa152e..0000000 --- a/GitHubRepoPublicReleaseApproval.md +++ /dev/null @@ -1,32 +0,0 @@ -# GitHub Repository Public Release Approval - -**Project Name:** NTIA/OSM Research and Development - -**Software Name:** Recommendation ITU-R P.2108, Python Wrapper - -The project identified above, which is contained within the repository this -document is stored in, has met the following criteria for public release: - -1. [x] The project, including the test criteria, meets the requirements defined -in the ITS Software Development Publication Policy for making a repository public. -The major pre-established criteria for publication are listed below, and the check -mark next to each attests that the criterion has been met. - * [x] Unit tests are available and the software has been tested against the unit tests. - * [x] The software can be compiled and/or used on Windows, macOS, and Linux. - * [x] The repository structure and contents follow from the ITS PropLib template, and - all template or placeholder code has been removed. - * [x] The repository includes the appropriate `LICENSE.md` file -2. [x] Any test data necessary for the code and its unit tests to function is included in this -GitHub repository, or in a parent repository which includes this one as a Git submodule. -3. [x] The README.md file has passed editorial review from the ITS Publications Office. -4. [x] The project complies with the ITS Code Style Guide or an appropriate style -guide as agreed to by the sponsor, project lead, or Supervising Division Chief. -5. [x] Approved disclaimer and licensing language has been included. - -In order to complete this approval, please create a new branch, upload and commit -your version of this Markdown document to that branch, then create a pull request -for that branch. The following must login to GitHub and approve that pull request -before the pull request can be merged and this repo made public: - -* Project Lead: Brian Lain -* Supervising Division Chief or Release Authority: Chris Anderson From 56e3da2757daf98d2dc4f478f9d1aa6753f1332c Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:05:50 -0500 Subject: [PATCH 17/83] Remove "U.S. Reference Implementation" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d31a5d8..69f1692 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Recommendation ITU-R P.2108 - U.S. Reference Implementation, Python # +# Recommendation ITU-R P.2108 - Python Wrapper # [![NTIA/ITS PropLib][proplib-badge]][proplib-link] [![GitHub Issues][gh-issues-badge]][gh-issues-link] From 6e5b86ec9db721bdc420b81057efe8cc6f5f82a1 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:47:41 -0500 Subject: [PATCH 18/83] Test fixing path filters --- .github/workflows/cff-validator.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cff-validator.yml b/.github/workflows/cff-validator.yml index a01dee3..83d75d0 100644 --- a/.github/workflows/cff-validator.yml +++ b/.github/workflows/cff-validator.yml @@ -3,12 +3,12 @@ name: Validate CITATION.cff on: push: paths: - - CITATION.cff - - .github/workflows/cff-validator.yml + - 'CITATION.cff' + - '.github/workflows/cff-validator.yml' pull_request: paths: - - CITATION.cff - - .github/workflows/cff-validator.yml + - 'CITATION.cff' + - '.github/workflows/cff-validator.yml' workflow_dispatch: jobs: From dabc99cb2d507de4336ce99a1e0f532651c3c606 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:51:29 -0500 Subject: [PATCH 19/83] Add link to template test data repo --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ddf94b..eabb052 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,13 @@ to develop a cross-platform Python interface to a compiled C++ library as part o PropLib. Instructions on how to use this repository are found in the [PropLib Template Wiki](https://github.com/NTIA/proplib-template/wiki). -Additional template repositories exist for building the C++ base repository and the -C#/.NET and MATLAB wrappers. See: +Additional template repositories exist for building the C++ base repository, the .NET +and MATLAB wrappers, and the test data repository. See: - [NTIA/proplib-template](https://github.com/NTIA/proplib-template) - [NTIA/proplib-template-dotnet](https://github.com/NTIA/proplib-template-dotnet) - [NTIA/proplib-template-matlab](https://github.com/NTIA/proplib-template-matlab) +- [NTIA/proplib-template-test-data](https://github.com/NTIA/proplib-template-test-data) ## Contact ## From d3e919292c83f83b96186efb8d33c5047899d46e Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:56:10 -0500 Subject: [PATCH 20/83] Fix incorrect field --- CITATION.cff | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CITATION.cff b/CITATION.cff index 98a9812..3d07367 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -18,8 +18,9 @@ authors: Institute for Telecommunication Sciences address: 325 Broadway city: Boulder - country: CO + country: US post-code: '80305' + region: Colorado alias: NTIA/ITS email: code@ntia.gov website: 'https://its.ntia.gov' From 670d3b1170fed9ff7db0109ed9280c1836ba3a77 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:25:24 -0500 Subject: [PATCH 21/83] Update approval form for test data requirements --- GitHubRepoPublicReleaseApproval.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitHubRepoPublicReleaseApproval.md b/GitHubRepoPublicReleaseApproval.md index ad5714a..85235a5 100644 --- a/GitHubRepoPublicReleaseApproval.md +++ b/GitHubRepoPublicReleaseApproval.md @@ -17,7 +17,7 @@ mark next to each attests that the criterion has been met. all template or placeholder code has been removed. * [ ] The repository includes the appropriate `LICENSE.md` file 2. [ ] Any test data necessary for the code and its unit tests to function is included in this -GitHub repository, or in a parent repository which includes this one as a Git submodule. +GitHub repository, either directly or as a linked Git submodule. 3. [ ] The README.md file has passed editorial review from the ITS Publications Office. 4. [ ] The project complies with the ITS Code Style Guide or an appropriate style guide as agreed to by the sponsor, project lead, or Supervising Division Chief. From ad6bb23eb17a40b9489a61314cb24c1d2a17f90b Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:29:38 -0500 Subject: [PATCH 22/83] Add zenodo template and README badge --- .zenodo.json | 36 ++++++++++++++++++++++++++++++++++++ README.md | 7 +++++++ 2 files changed, 43 insertions(+) create mode 100644 .zenodo.json diff --git a/.zenodo.json b/.zenodo.json new file mode 100644 index 0000000..c78dbcb --- /dev/null +++ b/.zenodo.json @@ -0,0 +1,36 @@ +{ + "upload_type": "software", + "publication_date": "TODO-TEMPLATE", + "title": "TODO-TEMPLATE", + "creators": [ + { + "name": "TODO-TEMPLATE", + "affiliation": "U.S. Department of Commerce, National Telecommunications and Information Administration, Institute for Telecommunication Sciences", + "orcid": "TODO-TEMPLATE" + } + ], + "description": "TODO-TEMPLATE. Make this the same as the abstract.", + "access_right": "open", + "keywords": [ + "TODO-TEMPLATE", + "TODO-TEMPLATE" + ], + "related_identifiers": [ + { + "identifier": "https://github.com/NTIA/TODO-TEMPLATE", + "relation": "isSupplementTo", + "resource_type": "software" + }, + { + "identifier": "https://github.com/NTIA/TODO-TEMPLATE-test-data", + "relation": "isSupplementedBy", + "resource_type": "software" + }, + { + "identifier": "https://ntia.github.io/propagation-library-wiki/models/TODO-TEMPLATE/", + "relation": "isDocumentedBy", + "resource_type": "softwaredocumentation" + } + ], + "version": "TODO-TEMPLATE" +} diff --git a/README.md b/README.md index eabb052..5262e00 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,10 @@ - The fourth badge displays open GitHub Issues - Update the repository name in [gh-issues-badge] - Update the repository name in [gh-issues-link] +- The fifth badge displays and links the Zenodo DOI + - Get your repository ID from https://api.github.com/repos/NTIA/{repo} + - Or, if private, follow: https://stackoverflow.com/a/47223479 + - Populate the repository ID in [doi-link] and [doi-badge] --> [![NTIA/ITS PropLib][proplib-badge]][proplib-link] [proplib-badge]: https://img.shields.io/badge/PropLib-badge?label=%F0%9F%87%BA%F0%9F%87%B8%20NTIA%2FITS&labelColor=162E51&color=D63E04 [proplib-link]: https://ntia.github.io/propagation-library-wiki @@ -28,6 +33,8 @@ [pypi-release-link]: https://pypi.org/project/TODO-TEMPLATE [gh-issues-badge]: https://img.shields.io/github/issues/NTIA/TODO-TEMPLATE?logo=github&label=Issues&labelColor=162E51 [gh-issues-link]: https://github.com/NTIA/TODO-TEMPLATE/issues +[doi-badge]: https://zenodo.org/badge/TODO-TEMPLATE.svg +[doi-link]: https://zenodo.org/badge/latestdoi/TODO-TEMPLATE This code repository is a template repository for Python wrappers in the NTIA/ITS From 8e89044a641479c0ffa9037fa8f3eb676da8ca77 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:30:09 -0500 Subject: [PATCH 23/83] Fix resource_type in template zenodo file --- .zenodo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zenodo.json b/.zenodo.json index c78dbcb..6bda553 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -24,7 +24,7 @@ { "identifier": "https://github.com/NTIA/TODO-TEMPLATE-test-data", "relation": "isSupplementedBy", - "resource_type": "software" + "resource_type": "dataset" }, { "identifier": "https://ntia.github.io/propagation-library-wiki/models/TODO-TEMPLATE/", From 0c93071d44ab511f3db677045073f6837702d96a Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:42:08 -0500 Subject: [PATCH 24/83] Prepare README for publication all badges will display properly once a PyPI release exists and the repository is published --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0ffe532..03207ff 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Recommendation ITU-R P.2108 - Python Wrapper # [![NTIA/ITS PropLib][proplib-badge]][proplib-link] +[![PyPI Release][pypi-release-badge]][pypi-release-link] [![GitHub Issues][gh-issues-badge]][gh-issues-link] - - +[![GitHub Actions Unit Test Status][gh-actions-test-badge]][gh-actions-test-link] [![DOI][doi-badge]][doi-link] [proplib-badge]: https://img.shields.io/badge/PropLib-badge?label=%F0%9F%87%BA%F0%9F%87%B8%20NTIA%2FITS&labelColor=162E51&color=D63E04 @@ -26,15 +26,11 @@ Section 3 of Annex 1 of the Recommendation. This Python package wraps the ## Getting Started ## -> [!NOTE] -> The text below indicates this package is distributed on PyPi, -> however it is not yet uploaded. A link will be provided here when available. - -This software is distributed on [PyPI](#) and is easily installable +This software is distributed on [PyPI](https://pypi.org/project/proplib-p2108) and is easily installable using the following command. ```cmd -pip install p2108 +pip install proplib-p2108 ``` General information about using this model is available on From 8cf84f72c31be00e12275084a802a15aa02eb423 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 09:10:59 -0500 Subject: [PATCH 25/83] Consistent bullet styling --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 03207ff..d4958e0 100644 --- a/README.md +++ b/README.md @@ -114,11 +114,11 @@ contains an extensive set of example values which are useful as validation cases ## References ## -* [ITS Propagation Library Wiki](https://ntia.github.io/propagation-library-wiki) -* [P2108 Wiki Page](https://ntia.github.io/propagation-library-wiki/models/P2108) -* [`ITS.ITU.PSeries.P2108` C++ API Reference](https://ntia.github.io/P2108) -* [Recommendation ITU-R P.2108](https://www.itu.int/rec/R-REC-P.2108/en) -* [Report ITU-R P.2402](https://www.itu.int/pub/R-REP-P.2402) +- [ITS Propagation Library Wiki](https://ntia.github.io/propagation-library-wiki) +- [P2108 Wiki Page](https://ntia.github.io/propagation-library-wiki/models/P2108) +- [`ITS.ITU.PSeries.P2108` C++ API Reference](https://ntia.github.io/P2108) +- [Recommendation ITU-R P.2108](https://www.itu.int/rec/R-REC-P.2108/en) +- [Report ITU-R P.2402](https://www.itu.int/pub/R-REP-P.2402) ## Contact ## From f470b5dbe8740e00bd1bf49f5e90da686bbfc3bb Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 09:12:40 -0500 Subject: [PATCH 26/83] Update markdownlink pre-commit hook --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7b9f374..c7ec2e1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: - id: black types: [file, python] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.42.0 + rev: v0.43.0 hooks: - id: markdownlint types: [file, markdown] From 21235c741c2797e0018770ae7844b5afb4425453 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:16:55 -0500 Subject: [PATCH 27/83] Migrate tox configuration into pyproject.toml --- pyproject.toml | 29 ++++++++++++++++++++++++++--- tox.ini | 25 ------------------------- 2 files changed, 26 insertions(+), 28 deletions(-) delete mode 100644 tox.ini diff --git a/pyproject.toml b/pyproject.toml index 1c842e8..573e5db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "proplib-template" # TODO-TEMPLATE update package name +name = "proplib-template" # TODO-TEMPLATE update package name dynamic = ["version"] description = "TODO-TEMPLATE" readme = "README.md" @@ -37,12 +37,12 @@ classifiers = [ tests = [ "pytest>=8.2.0,<9.0", "pytest-cov>=6.0.0,<7.0", - "tox>=4.23.2,<5.0", # Keep in sync with tox.ini minimum_version + "tox>=4.21.1,<5.0", # Keep in sync with tool.tox.min_version ] dev = [ "hatchling>=1.25.0,<2.0", "pre-commit>=4.0.1,<5.0", - "proplib-template[tests]", # TODO-TEMPLATE set to this package + "proplib-template[tests]", # TODO-TEMPLATE set to this package ] [project.urls] @@ -63,3 +63,26 @@ ignore-vcs = true [tool.cibuildwheel] test-command = "pytest ." test-requires = "pytest" + +[tool.tox] +min_version = "4.21.1" +env_list = ["3.9", "3.10", "3.11", "3.12", "3.13"] +skip_missing_interpreters = true # TODO override this in GHA + +[tool.tox.env.testenv] +description = "Run tests with pytest and generate coverage report" +extras = "tests" +commands = [ + "pytest", + "--cov-report=term-missing", + "--no-cov-on-fail", + "--cov", + { replace = "posargs", extend = true }, +] + +[tool.tox.gh.python] # tox-gh config for GitHub Actions testing +"3.9" = ["3.9"] +"3.10" = ["3.10"] +"3.11" = ["3.11"] +"3.12" = ["3.12"] +"3.13" = ["3.13"] diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 2104a05..0000000 --- a/tox.ini +++ /dev/null @@ -1,25 +0,0 @@ -[tox] -env_list = - py39 - py310 - py311 - py312 - py313 -min_version = 4.23.2 -skip_missing_interpreters = true -no_package = false - -[testenv] -description = Run tests with pytest and generate coverage report -package = wheel -wheel_build_env = .pkg -extras = tests -commands = pytest --cov-report term-missing --no-cov-on-fail --cov {posargs} - -[gh] ; GitHub Actions CI with tox-gh -python = - 3.9 = py39 - 3.10 = py310 - 3.11 = py311 - 3.12 = py312 - 3.13 = py313 From 201c315d06bd31751ac7016c0d58ad729b89f90a Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:17:11 -0500 Subject: [PATCH 28/83] Remove CMakeLists.txt --- CMakeLists.txt | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 594d238..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -########################################### -## COPY COMPILED LIBRARY INTO WRAPPER -########################################### -# This file is expected to be called from a higher-level -# CMakeLists.txt when compiling the C++ library. - -# Where to place compiled library for Python wrapper -# TODO-TEMPLATE: Update this directory for your library namespace -set(PYTHON_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/ITS/.../${LIB_NAME}/) - -add_custom_target( - COPY_LIB_TO_PYTHON ALL - COMMAND ${CMAKE_COMMAND} -E copy $ ${PYTHON_LIB_DIR} - DEPENDS ${LIB_NAME} - COMMENT "Copying library to Python wrapper directory" -) From f1a67b4734e47384a4c7118bcd3c72efb31f10cf Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:59:07 -0500 Subject: [PATCH 29/83] Update test data directory --- tests/test_proplib_template.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_proplib_template.py b/tests/test_proplib_template.py index 91c4072..00637db 100644 --- a/tests/test_proplib_template.py +++ b/tests/test_proplib_template.py @@ -7,9 +7,8 @@ # TODO-TEMPLATE: Import the python wrapper package from ITS import PropLibTemplate -# Test data is expected to exist in parent repository -# (i.e., that this Python wrapper repo is cloned as a submodule of the base repo) -TEST_DATA_DIR = (Path(__file__).parent.parent.parent.parent / "tests") / "data" +# Test data is expected to exist in extern/-test-data +TEST_DATA_DIR = (Path(__file__).parent.parent / "extern") / "TODO-TEMPLATE" ABSTOL__DB = 0.1 # Absolute tolerance, in dB, to ensure outputs match expected value From 6f6f8accd8124513d3fbd4f64283ff1036964639 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:02:15 -0500 Subject: [PATCH 30/83] Update README --- README.md | 55 ++++++++++++++++++++++++------------------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 5262e00..3785637 100644 --- a/README.md +++ b/README.md @@ -91,42 +91,37 @@ this either from the compiling it yourself from the C++ source code. Either way, ensure that the shared library (`.dll`, `.dylib`, or `.so` file) is placed in `src/TODO-TEMPLATE/MODEL-NAMESPACE/`, alongside `__init__.py`. -Below are the steps to build and install the Python package from source, including -compiling the library from the C++ source code. Working installations of Git and -Python (3.9 or above) are required. If compiling the shared library, CMake and a C++ compiler -are also required. +Below are the steps to build and install the Python package from the source code. +Working installations of Git and a [currently-supported version](https://devguide.python.org/versions/) +of Python are required. Additional requirements exist if you want to compile the shared +library from C++ source code; see relevant build instructions +[here](https://github.com/NTIA/TODO-TEMPLATE?tab=readme-ov-file#configure-and-build). + +1. Optionally, configure and activate a virtual environment using a tool such as +[`venv`](https://docs.python.org/3/library/venv.html) or +[conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html). -1. Clone the parent repository, then initialize the Git submodule containing the -Python wrapper. This repository structure makes test data available to the Python -wrapper. +1. Clone this repository, then initialize the Git submodule containing the test data. ```cmd - # Clone the parent repository + # Clone the repository git clone https://github.com/NTIA/TODO-TEMPLATE cd TODO-TEMPLATE - # Initialize Git submodules (wrappers and external dependencies) + # Initialize Git submodule containing test data git submodule init - # Clone the submodules + # Clone the submodule git submodule update ``` -1. Compile the C++ library for your platform, following instructions -[here](https://github.com/NTIA/TODO-TEMPLATE?tab=readme-ov-file#configure-and-build). -Following these instructions should automatically copy the shared library -into the location required by the Python wrapper. - - **OR** - - Download the shared library (`.dll`, `.so`, or `.dylib`) from a - [GitHub Release](https://github.com/NTIA/TODO-TEMPLATE/releases). Then place the - downloaded file in `src/TODO-TEMPLATE/MODEL-NAMESPACE/` (alongside `__init__.py`). +1. Download the shared library (`.dll`, `.so`, or `.dylib`) from a +[GitHub Release](https://github.com/NTIA/TODO-TEMPLATE/releases). Then place the +downloaded file in `src/TODO-TEMPLATE/MODEL-NAMESPACE/` (alongside `__init__.py`). -1. Install the local package and development dependencies: +1. Install the local package and development dependencies into your current environment: ```cmd - cd wrap/python pip install .[dev] ``` @@ -138,11 +133,9 @@ into the location required by the Python wrapper. ### Running Tests ### -Python unit tests can be run to confirm successful installation. Test data is -expected to be located in the parent repository. Therefore, if you haven't cloned -this repository as a submodule (as described above), you will need to first specify -the location of the test data files in `tests/test_.py` (using the `TEST_DATA_DIR` -variable). Then, run the tests with pytest: +Python unit tests can be run to confirm successful installation. You will need to +clone this repository's test data submodule (as described above). Then, run the tests +with pytest using the following command. ```cmd pytest @@ -152,10 +145,10 @@ pytest TODO-TEMPLATE: Update references -* [ITS Propagation Library Wiki](https://ntia.github.io/propagation-library-wiki) -* [TODO-TEMPLATE Wiki Page](https://ntia.github.io/propagation-library-wiki/models/TODO-TEMPLATE) -* [`TODO-TEMPLATE` C++ API Reference](https://ntia.github.io/TODO-TEMPLATE) -* TODO-TEMPLATE: Link supporting documentation such as ITU-R Recommendations, NTIA reports, etc. +- [ITS Propagation Library Wiki](https://ntia.github.io/propagation-library-wiki) +- [TODO-TEMPLATE Wiki Page](https://ntia.github.io/propagation-library-wiki/models/TODO-TEMPLATE) +- [`TODO-TEMPLATE` C++ API Reference](https://ntia.github.io/TODO-TEMPLATE) +- TODO-TEMPLATE: Link supporting documentation such as ITU-R Recommendations, NTIA reports, etc. ## Contact ## From a7b6084b7182dc72eaa308342bc6f6fb12b02ec0 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:02:40 -0500 Subject: [PATCH 31/83] Initialize extern directory for submodule --- extern/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 extern/README.md diff --git a/extern/README.md b/extern/README.md new file mode 100644 index 0000000..eed1724 --- /dev/null +++ b/extern/README.md @@ -0,0 +1,3 @@ +# External Dependencies + +This directory is used for external dependencies and/or Git submodules. From d9ac58d58cc04eeb1388ef9979f7729937054e8c Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:05:19 -0500 Subject: [PATCH 32/83] Rename test_utils file --- tests/{test_proplib_template.py => test_utils.py} | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) rename tests/{test_proplib_template.py => test_utils.py} (64%) diff --git a/tests/test_proplib_template.py b/tests/test_utils.py similarity index 64% rename from tests/test_proplib_template.py rename to tests/test_utils.py index 00637db..c96aff4 100644 --- a/tests/test_proplib_template.py +++ b/tests/test_utils.py @@ -1,13 +1,7 @@ -# TODO-TEMPLATE: Rename this file import csv from pathlib import Path -import pytest - -# TODO-TEMPLATE: Import the python wrapper package -from ITS import PropLibTemplate - -# Test data is expected to exist in extern/-test-data +# Test data is expected to exist in extern/TODO-TEMPLATE-test-data TEST_DATA_DIR = (Path(__file__).parent.parent / "extern") / "TODO-TEMPLATE" ABSTOL__DB = 0.1 # Absolute tolerance, in dB, to ensure outputs match expected value @@ -18,10 +12,10 @@ def read_csv_test_data(filename: str): reader = csv.reader(f) next(reader) # Skip header row for row in reader: - # yield (inputs, rtn, output) + # yields (*inputs, rtn, output) yield tuple(map(float, row[:-2])), int(row[-2]), float(row[-1]) -# TODO-TEMPLATE: Implement unit tests for this Python wrapper +# TODO-TEMPLATE: Delete this dummy test and write your own in another file. def test_always_pass(): return From 4c1f40359ad7bc1b844fbdf22112235fe6be5892 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:08:00 -0500 Subject: [PATCH 33/83] Partial zenodo metadata --- .zenodo.json | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 6bda553..4b2fcbb 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,36 +1,38 @@ { "upload_type": "software", - "publication_date": "TODO-TEMPLATE", - "title": "TODO-TEMPLATE", + "publication_date": "2024-12-11", + "title": "Recommendation ITU-R P.2108, Python Wrapper", "creators": [ { - "name": "TODO-TEMPLATE", + "name": "Romaniello, Anthony W.", "affiliation": "U.S. Department of Commerce, National Telecommunications and Information Administration, Institute for Telecommunication Sciences", - "orcid": "TODO-TEMPLATE" + "orcid": "0000-0001-8437-6504" } ], "description": "TODO-TEMPLATE. Make this the same as the abstract.", "access_right": "open", "keywords": [ - "TODO-TEMPLATE", - "TODO-TEMPLATE" + "clutter", + "ITU", + "ITU-R", + "propagation" ], "related_identifiers": [ { - "identifier": "https://github.com/NTIA/TODO-TEMPLATE", + "identifier": "https://github.com/NTIA/p2108", "relation": "isSupplementTo", "resource_type": "software" }, { - "identifier": "https://github.com/NTIA/TODO-TEMPLATE-test-data", + "identifier": "https://github.com/NTIA/p2108-test-data", "relation": "isSupplementedBy", "resource_type": "dataset" }, { - "identifier": "https://ntia.github.io/propagation-library-wiki/models/TODO-TEMPLATE/", + "identifier": "https://ntia.github.io/propagation-library-wiki/models/P2108/", "relation": "isDocumentedBy", "resource_type": "softwaredocumentation" } ], - "version": "TODO-TEMPLATE" + "version": "1.0.0" } From b258e4c29b3abccf77edaa95ac47db833cb93aba Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:17:19 -0500 Subject: [PATCH 34/83] Update README abstract and trademark symbol placement --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8980d26..ef2b2fe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Recommendation ITU-R P.2108 - Python Wrapper # +# Recommendation ITU-R P.2108 - Python® Wrapper # [![NTIA/ITS PropLib][proplib-badge]][proplib-link] [![PyPI Release][pypi-release-badge]][pypi-release-link] @@ -17,12 +17,12 @@ [doi-badge]: https://zenodo.org/badge/804561453.svg [doi-link]: https://zenodo.org/badge/latestdoi/804561453 -This repository contains a Python® wrapper for the NTIA/ITS implementation of +This repository contains a Python wrapper for the NTIA/ITS implementation of Recommendation ITU-R P.2108. This Recommendation contains three methods for the prediction of clutter loss: Height Gain Terminal Correction Model, Terrestrial Statistical Model, and Aeronautical Statistical Model. The software implements Section 3 of Annex 1 of the Recommendation. This Python package wraps the -[base C++ implementation](https://github.com/NTIA/p2108). +[NTIA/ITS C++ implementation](https://github.com/NTIA/p2108). ## Getting Started ## @@ -56,7 +56,7 @@ Below are the steps to build and install the Python package from the source code Working installations of Git and a [currently-supported version](https://devguide.python.org/versions/) of Python are required. Additional requirements exist if you want to compile the shared library from C++ source code; see relevant build instructions -[here](https://github.com/NTIA/TODO-TEMPLATE?tab=readme-ov-file#configure-and-build). +[here](https://github.com/NTIA/p2108?tab=readme-ov-file#configure-and-build). 1. Optionally, configure and activate a virtual environment using a tool such as [`venv`](https://docs.python.org/3/library/venv.html) or From 9d59b38d3e22b51d30783f439aac0c88802deac7 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:17:35 -0500 Subject: [PATCH 35/83] Finish zenodo metadata --- .zenodo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zenodo.json b/.zenodo.json index 4b2fcbb..d513267 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -9,7 +9,7 @@ "orcid": "0000-0001-8437-6504" } ], - "description": "TODO-TEMPLATE. Make this the same as the abstract.", + "description": "This repository contains a Python wrapper for the NTIA/ITS implementation of Recommendation ITU-R P.2108. This Recommendation contains three methods for the prediction of clutter loss: Height Gain Terminal Correction Model, Terrestrial Statistical Model, and Aeronautical Statistical Model. The software implements Section 3 of Annex 1 of the Recommendation. This Python package wraps the NTIA/ITS C++ implementation.", "access_right": "open", "keywords": [ "clutter", From b8251f50b9d9d568165b360e63455f3a009a6bce Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:17:49 -0500 Subject: [PATCH 36/83] Populate public release approval form details --- GitHubRepoPublicReleaseApproval.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GitHubRepoPublicReleaseApproval.md b/GitHubRepoPublicReleaseApproval.md index 85235a5..551834d 100644 --- a/GitHubRepoPublicReleaseApproval.md +++ b/GitHubRepoPublicReleaseApproval.md @@ -2,7 +2,7 @@ **Project Name:** NTIA/OSM Research and Development -**Software Name:** TODO-TEMPLATE +**Software Name:** Recommendation ITU-R P.2108, Python Wrapper The project identified above, which is contained within the repository this document is stored in, has met the following criteria for public release: @@ -28,5 +28,5 @@ your version of this Markdown document to that branch, then create a pull reques for that branch. The following must login to GitHub and approve that pull request before the pull request can be merged and this repo made public: -* Project Lead: TODO-TEMPLATE -* Supervising Division Chief or Release Authority: TODO-TEMPLATE +* Project Lead: Brian Lain +* Supervising Division Chief or Release Authority: Chris Anderson From 77692410f5b61f9f44dea7c805f018d9db1cd8ef Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:20:04 -0500 Subject: [PATCH 37/83] Run pre-commit hooks on all files --- tests/test_p2108.py | 4 +++- tests/test_utils.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_p2108.py b/tests/test_p2108.py index d6233a8..24df67b 100644 --- a/tests/test_p2108.py +++ b/tests/test_p2108.py @@ -1,8 +1,10 @@ -from .test_utils import ABSTOL__DB, read_csv_test_data import pytest from ITS.ITU.PSeries import P2108 +from .test_utils import ABSTOL__DB, read_csv_test_data + + @pytest.mark.parametrize( "inputs,rtn,expected", read_csv_test_data("AeronauticalStatisticalModelTestData.csv"), diff --git a/tests/test_utils.py b/tests/test_utils.py index 27f5b7b..448055b 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -5,6 +5,7 @@ TEST_DATA_DIR = (Path(__file__).parent.parent / "extern") / "p2108-test-data" ABSTOL__DB = 0.1 # Absolute tolerance, in dB, to ensure outputs match expected value + def read_csv_test_data(filename: str): with open(TEST_DATA_DIR / filename) as f: reader = csv.reader(f) From 57b56d457d5b07e215a69102b699a4f906fee8b9 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:29:47 -0500 Subject: [PATCH 38/83] Update test data expected location --- .gitmodules | 3 +++ extern/README.md | 3 --- tests/__init__.py | 0 tests/data | 1 + tests/test_utils.py | 12 ++++++++++-- 5 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 .gitmodules delete mode 100644 extern/README.md create mode 100644 tests/__init__.py create mode 160000 tests/data diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e1abd5e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tests/data"] + path = tests/data + url = https://github.com/NTIA/p2108-test-data diff --git a/extern/README.md b/extern/README.md deleted file mode 100644 index eed1724..0000000 --- a/extern/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# External Dependencies - -This directory is used for external dependencies and/or Git submodules. diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/data b/tests/data new file mode 160000 index 0000000..8a8497d --- /dev/null +++ b/tests/data @@ -0,0 +1 @@ +Subproject commit 8a8497da1ce996d00ba6f291079117c5098b8ded diff --git a/tests/test_utils.py b/tests/test_utils.py index 448055b..258e994 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,10 +1,18 @@ import csv from pathlib import Path -# Test data is expected to exist in extern/p2108-test-data -TEST_DATA_DIR = (Path(__file__).parent.parent / "extern") / "p2108-test-data" +# Test data is expected to exist in tests/data +TEST_DATA_DIR = Path(__file__).parent / "data" ABSTOL__DB = 0.1 # Absolute tolerance, in dB, to ensure outputs match expected value +# Check if test data directory exists and is not empty +if not TEST_DATA_DIR.exists() or not any(TEST_DATA_DIR.iterdir()): + _test_data_checked = True + raise RuntimeError( + f"Test data is not available in {TEST_DATA_DIR}.\n Try running " + + "`git submodule init` and `git submodule update` to clone the test data submodule." + ) + def read_csv_test_data(filename: str): with open(TEST_DATA_DIR / filename) as f: From 6f7c9f85c8e5649a0e1a402105e6237d3816d399 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:31:09 -0500 Subject: [PATCH 39/83] Move expected test data directory to tests/data --- extern/README.md | 3 --- tests/test_utils.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 extern/README.md diff --git a/extern/README.md b/extern/README.md deleted file mode 100644 index eed1724..0000000 --- a/extern/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# External Dependencies - -This directory is used for external dependencies and/or Git submodules. diff --git a/tests/test_utils.py b/tests/test_utils.py index c96aff4..4a6a2ce 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,8 +1,8 @@ import csv from pathlib import Path -# Test data is expected to exist in extern/TODO-TEMPLATE-test-data -TEST_DATA_DIR = (Path(__file__).parent.parent / "extern") / "TODO-TEMPLATE" +# Test data is expected to exist in tests/data +TEST_DATA_DIR = Path(__file__).parent / "data" ABSTOL__DB = 0.1 # Absolute tolerance, in dB, to ensure outputs match expected value From 8de1928a287987fd07ff92aab6b0d9d2d133559d Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:11:11 -0500 Subject: [PATCH 40/83] Fix CITATION.cff validator for Ubuntu 24.04 runner --- .github/workflows/cff-validator.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cff-validator.yml b/.github/workflows/cff-validator.yml index 83d75d0..6fce818 100644 --- a/.github/workflows/cff-validator.yml +++ b/.github/workflows/cff-validator.yml @@ -23,3 +23,5 @@ jobs: uses: actions/checkout@v4 - name: Validate CITATION.cff uses: dieghernan/cff-validator@v3 + with: + install-r: true From c948c24821fdb7bada0f5d80a9181033059ed064 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:16:53 -0500 Subject: [PATCH 41/83] Update pyupgrade pre-commit hook --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c7ec2e1..5d06997 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: v3.19.0 + rev: v3.19.1 hooks: - id: pyupgrade args: ["--py39-plus"] From 4877693af44d72d865fc75b07889d38b1fe87625 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:25:35 -0500 Subject: [PATCH 42/83] Remove keyword resulting in misleading zenodo content --- .zenodo.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.zenodo.json b/.zenodo.json index 6bda553..c407507 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -10,7 +10,6 @@ } ], "description": "TODO-TEMPLATE. Make this the same as the abstract.", - "access_right": "open", "keywords": [ "TODO-TEMPLATE", "TODO-TEMPLATE" From 51593f68e2a9922fd8dc2d8dcfc7cba4ab68a36e Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:02:45 -0500 Subject: [PATCH 43/83] Add PropLib Wiki link to metadata --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 573e5db..454ad32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,6 +46,7 @@ dev = [ ] [project.urls] +"PropLib Wiki" = "https://ntia.github.io/propagation-library-wiki/models/TODO-TEMPLATE/" "Python Wrapper Source" = "https://github.com/NTIA/TODO-TEMPLATE" "Python Wrapper Bug Tracker" = "https://github.com/NTIA/TODO-TEMPLATE/issues" "C++ Source" = "https://github.com/NTIA/TODO-TEMPLATE" From 60b44888ffdbb0ab9a31a6816e7d314d519ed13c Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:02:59 -0500 Subject: [PATCH 44/83] Add license and disclaimer information --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 3785637..5d4b25c 100644 --- a/README.md +++ b/README.md @@ -150,8 +150,18 @@ TODO-TEMPLATE: Update references - [`TODO-TEMPLATE` C++ API Reference](https://ntia.github.io/TODO-TEMPLATE) - TODO-TEMPLATE: Link supporting documentation such as ITU-R Recommendations, NTIA reports, etc. +## License ## + +See [LICENSE](./LICENSE.md). + +"Python" and the Python logos are trademarks or registered trademarks of the Python Software Foundation, used by the National Telecommunications and Information Administration with permission from the Foundation. + ## Contact ## For technical questions, contact . +## Disclaimer ## + +Certain commercial equipment, instruments, or materials are identified in this project were used for the convenience of the developers. In no case does such identification imply recommendation or endorsement by the National Telecommunications and Information Administration, nor does it imply that the material or equipment identified is necessarily the best available for the purpose. + --> From 1b417af81978be667e2249014c49a4e0d2ad4fbf Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:19:15 -0500 Subject: [PATCH 45/83] Deduplicate workflow runs --- .github/workflows/cff-validator.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cff-validator.yml b/.github/workflows/cff-validator.yml index 6fce818..27c0abc 100644 --- a/.github/workflows/cff-validator.yml +++ b/.github/workflows/cff-validator.yml @@ -2,10 +2,12 @@ name: Validate CITATION.cff on: push: + branches: ["main", "dev"] paths: - 'CITATION.cff' - '.github/workflows/cff-validator.yml' pull_request: + branches: ["main", "dev"] paths: - 'CITATION.cff' - '.github/workflows/cff-validator.yml' From dda2ecf4b8e1fad6a362f09bf174d6877a356d8c Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:34:02 -0500 Subject: [PATCH 46/83] Add Wiki link to metadata --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e44b607..62a826a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,7 @@ dev = [ "P2108[tests]", ] [project.urls] +"PropLib Wiki" = "https://ntia.github.io/propagation-library-wiki/models/P2108/" "Python Wrapper Source" = "https://github.com/NTIA/p2108-python" "Python Wrapper Bug Tracker" = "https://github.com/NTIA/p2108-python/issues" "C++ Source" = "https://github.com/NTIA/p2108" From 30d30e9d4597c0ed383a7dfd95e8f26b7009ce5a Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:34:31 -0500 Subject: [PATCH 47/83] Fix badge order --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef2b2fe..bf08348 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ [![NTIA/ITS PropLib][proplib-badge]][proplib-link] [![PyPI Release][pypi-release-badge]][pypi-release-link] -[![GitHub Issues][gh-issues-badge]][gh-issues-link] [![GitHub Actions Unit Test Status][gh-actions-test-badge]][gh-actions-test-link] +[![GitHub Issues][gh-issues-badge]][gh-issues-link] [![DOI][doi-badge]][doi-link] [proplib-badge]: https://img.shields.io/badge/PropLib-badge?label=%F0%9F%87%BA%F0%9F%87%B8%20NTIA%2FITS&labelColor=162E51&color=D63E04 From ada6489c56abdb9ef8f3617cdb67b3f30d76223f Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:08:32 -0500 Subject: [PATCH 48/83] Finalize multiplatform library file name extensions --- src/ITS/ITU/PSeries/P2108/proplib_loader.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ITS/ITU/PSeries/P2108/proplib_loader.py b/src/ITS/ITU/PSeries/P2108/proplib_loader.py index ff8312d..6859f4c 100644 --- a/src/ITS/ITU/PSeries/P2108/proplib_loader.py +++ b/src/ITS/ITU/PSeries/P2108/proplib_loader.py @@ -43,6 +43,7 @@ """ import platform +import struct from ctypes import * from pathlib import Path @@ -71,11 +72,19 @@ def get_lib_name(lib_name: str) -> str: """ # Load the compiled library if platform.uname()[0] == "Windows": - lib_name += ".dll" + arch = struct.calcsize("P") * 8 # 32 or 64 + if arch == 64: + lib_name += "-x64.dll" + elif arch == 32: + lib_name += "-x86.dll" + else: + raise RuntimeError( + "Failed to determine system architecture for DLL loading" + ) elif platform.uname()[0] == "Linux": - lib_name += ".so" + lib_name += "-x86_64.so" elif platform.uname()[0] == "Darwin": - lib_name += ".dylib" + lib_name += "-universal.dylib" else: raise NotImplementedError("Your OS is not yet supported") # Library should be in the same directory as this file From 896738af2dd15708ee7f2b9e3a75a99b38b2c4f0 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:09:39 -0500 Subject: [PATCH 49/83] Initial testing of CI testing workflow --- .github/workflows/tox.yml | 88 +++++++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tox.yml diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml new file mode 100644 index 0000000..4b35dbc --- /dev/null +++ b/.github/workflows/tox.yml @@ -0,0 +1,88 @@ +name: Tox + +on: + workflow_dispatch: + push: + branches: + - main + - dev + - pre-publish-revisions # TESTING + paths: + - src + - tests + - pyproject.toml + - .github\workflows\tox.yml + pull_request: + branches: + - main + paths: + - src + - tests + - pyproject.toml + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +env: + LIBRARY_RELEASE_TAG: v1.0-rc.1 + LIBRARY_DESTINATION_DIRECTORY: 'src/ITS/ITU/PSeries/P2108/' + +jobs: + run-all-tests: + name: Py${{ matrix.py }} / ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + release-files: '*-x64.dll' + # - os: windows-latest + # release-files: '*-x86.dll' + - os: macos-latest + release-files: '*.dylib' + - os: ubuntu-latest + release-files: '*.so' + py: + - "3.9" + # - "3.10" + # - "3.11" + # - "3.12" + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + submodules: true + - name: Restore ${{ env.LIBRARY_RELEASE_TAG }} binaries from cache if available + id: cache-restore + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-${{ env.LIBRARY_RELEASE_TAG }} + path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.release-files }} + - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} binaries + if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }} + uses: robinraju/release-downloader@v1 + with: + repository: 'NTIA/p2108' + tag: '$LIBRARY_RELEASE_TAG' + fileName: '${{ matrix.release-files }}' + tarBall: false + zipBall: false + out-file-path: '$LIBRARY_DESTINATION_DIRECTORY' + - name: TEMP check downloaded files + if: ${{ runner.os != 'Windows' }} + run: ls $env:LIBRARY_DESTINATION_DIRECTORY + - name: Set up Python ${{ matrix.py }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.py }} + cache: 'pip' + - name: Install tox-gh + run: python -m pip install tox-gh + - name: Set up test suite + run: tox r -vv --notest --skip-missing-interpreters false + - name: Run test suite + run: tox r --skip-pkg-install + env: + PYTEST_ADDOPTS: "-vv --durations=0" diff --git a/pyproject.toml b/pyproject.toml index 62a826a..deda25f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ test-requires = "pytest" [tool.tox] min_version = "4.21.1" env_list = ["3.9", "3.10", "3.11", "3.12", "3.13"] -skip_missing_interpreters = true # TODO override this in GHA +skip_missing_interpreters = true [tool.tox.env.testenv] description = "Run tests with pytest and generate coverage report" From 010309aa370ad8ddc6b11beea91401558454df83 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:14:05 -0500 Subject: [PATCH 50/83] Fix environment variable syntax --- .github/workflows/tox.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 4b35dbc..6d3eb8d 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -65,11 +65,11 @@ jobs: uses: robinraju/release-downloader@v1 with: repository: 'NTIA/p2108' - tag: '$LIBRARY_RELEASE_TAG' + tag: ${{ env.LIBRARY_RELEASE_TAG }} fileName: '${{ matrix.release-files }}' tarBall: false zipBall: false - out-file-path: '$LIBRARY_DESTINATION_DIRECTORY' + out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} - name: TEMP check downloaded files if: ${{ runner.os != 'Windows' }} run: ls $env:LIBRARY_DESTINATION_DIRECTORY From a68f8d2f0dec4ba112ee284f533a5b8e419680ef Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:16:07 -0500 Subject: [PATCH 51/83] fix environment variable in debug step --- .github/workflows/tox.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 6d3eb8d..24c74df 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -72,7 +72,7 @@ jobs: out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} - name: TEMP check downloaded files if: ${{ runner.os != 'Windows' }} - run: ls $env:LIBRARY_DESTINATION_DIRECTORY + run: ls $LIBRARY_DESTINATION_DIRECTORY - name: Set up Python ${{ matrix.py }} uses: actions/setup-python@v5 with: From 49b42b14bb4d3748660fd1f052f565c2ef54a44b Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:52:10 -0500 Subject: [PATCH 52/83] Test configure matrix with environment variable --- .github/workflows/tox.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 24c74df..237f601 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -27,6 +27,7 @@ concurrency: env: LIBRARY_RELEASE_TAG: v1.0-rc.1 LIBRARY_DESTINATION_DIRECTORY: 'src/ITS/ITU/PSeries/P2108/' + PYTHON_VERSIONS: "['3.9', '3.10', '3.11', '3.12']" jobs: run-all-tests: @@ -38,14 +39,15 @@ jobs: include: - os: windows-latest release-files: '*-x64.dll' + py: $PYTHON_VERSIONS # - os: windows-latest # release-files: '*-x86.dll' - os: macos-latest release-files: '*.dylib' - os: ubuntu-latest release-files: '*.so' - py: - - "3.9" + # py: + # - "3.9" # - "3.10" # - "3.11" # - "3.12" @@ -70,9 +72,6 @@ jobs: tarBall: false zipBall: false out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} - - name: TEMP check downloaded files - if: ${{ runner.os != 'Windows' }} - run: ls $LIBRARY_DESTINATION_DIRECTORY - name: Set up Python ${{ matrix.py }} uses: actions/setup-python@v5 with: From 99a296cdd21585a48ee375e2171127eee8fb1654 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:56:17 -0500 Subject: [PATCH 53/83] Modify test matrix --- .github/workflows/tox.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 237f601..609f731 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -36,21 +36,22 @@ jobs: strategy: fail-fast: false matrix: + os: ['windows-latest', 'macos-latest', 'ubuntu-latest'] + release-files: ['*-x64.dll', '*-x86.dll', '*.dylib', '*.so'] + py: + - "3.9" + - "3.10" + - "3.11" + - "3.12" include: - os: windows-latest release-files: '*-x64.dll' - py: $PYTHON_VERSIONS - # - os: windows-latest - # release-files: '*-x86.dll' + - os: windows-latest + release-files: '*-x86.dll' - os: macos-latest release-files: '*.dylib' - os: ubuntu-latest release-files: '*.so' - # py: - # - "3.9" - # - "3.10" - # - "3.11" - # - "3.12" steps: - name: Check out repository uses: actions/checkout@v4 From 50beacdd1a16b1f959af94fe3d7d3e23ddaf59ba Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:02:18 -0500 Subject: [PATCH 54/83] Modify testing matrix --- .github/workflows/tox.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 609f731..9fa3ad5 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -36,8 +36,6 @@ jobs: strategy: fail-fast: false matrix: - os: ['windows-latest', 'macos-latest', 'ubuntu-latest'] - release-files: ['*-x64.dll', '*-x86.dll', '*.dylib', '*.so'] py: - "3.9" - "3.10" From 7922681dce32714056fa6987e25dc09c453eb6f7 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:22:09 -0500 Subject: [PATCH 55/83] Test workflow matrix exclusion --- .github/workflows/tox.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 9fa3ad5..4bd8503 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -27,7 +27,6 @@ concurrency: env: LIBRARY_RELEASE_TAG: v1.0-rc.1 LIBRARY_DESTINATION_DIRECTORY: 'src/ITS/ITU/PSeries/P2108/' - PYTHON_VERSIONS: "['3.9', '3.10', '3.11', '3.12']" jobs: run-all-tests: @@ -36,20 +35,28 @@ jobs: strategy: fail-fast: false matrix: + os: ['windows-latest', 'macos-latest', 'ubuntu-latest'] + release-files: ['*-x64.dll', '*-x86.dll', '*.dylib', '*.so'] + # arch: ['32-bit', '64-bit'] py: - "3.9" - "3.10" - "3.11" - "3.12" - include: - - os: windows-latest - release-files: '*-x64.dll' - - os: windows-latest - release-files: '*-x86.dll' - - os: macos-latest - release-files: '*.dylib' - - os: ubuntu-latest - release-files: '*.so' + exclude: + - os: windows-latest + release-files: ['*.dylib', '*.so'] + - os: macos-latest + - os: ubuntu-latest + # include: + # - os: windows-latest + # release-files: '*-x64.dll' + # - os: windows-latest + # release-files: '*-x86.dll' + # - os: macos-latest + # release-files: '*.dylib' + # - os: ubuntu-latest + # release-files: '*.so' steps: - name: Check out repository uses: actions/checkout@v4 From fbda497fa97a9aca1eca22f192d784589ccab21d Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:44:03 -0500 Subject: [PATCH 56/83] Remove 32-bit testing --- .github/workflows/tox.yml | 50 ++++++++++++--------- src/ITS/ITU/PSeries/P2108/proplib_loader.py | 11 +---- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 4bd8503..b34e9a5 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -30,54 +30,60 @@ env: jobs: run-all-tests: - name: Py${{ matrix.py }} / ${{ matrix.os }} - runs-on: ${{ matrix.os }} + name: ${{ matrix.os[0] }} (${{ matrix.arch[0] }}) / Py${{ matrix.py }} + runs-on: ${{ matrix.os[1] }} strategy: fail-fast: false matrix: - os: ['windows-latest', 'macos-latest', 'ubuntu-latest'] - release-files: ['*-x64.dll', '*-x86.dll', '*.dylib', '*.so'] - # arch: ['32-bit', '64-bit'] - py: + os: # OS: ["nicely formatted name", "GitHub runner name"] + - ['Windows', 'windows-latest'] + - ['macOS', 'macos-latest'] + - ['Linux', ubuntu-latest'] + arch: # Architecture: ["name", "file pattern to grab from release"] + - ['x64', '-x64.dll'] # Windows 32-bit + - ['universal', '*.dylib'] # macOS Universal + - ['x86_64', '*.so'] # Linux x86_64 + py: # Python versions; should exist in pyproject.toml [tool.tox.gh.python] - "3.9" - "3.10" - "3.11" - "3.12" - exclude: + exclude: # Exclude all matrix combinations + - os: ['Windows', 'windows-latest'] + - os: ['macOS', 'macos-latest'] + - os: ['Linux', ubuntu-latest'] + include: # Selectively include desired OS/architecture combinations - os: windows-latest - release-files: ['*.dylib', '*.so'] - - os: macos-latest - - os: ubuntu-latest - # include: - # - os: windows-latest - # release-files: '*-x64.dll' - # - os: windows-latest - # release-files: '*-x86.dll' - # - os: macos-latest - # release-files: '*.dylib' - # - os: ubuntu-latest - # release-files: '*.so' + arch: ['x64', '-x64.dll'] + # - os: macos-latest + # arch: ['universal', '*.dylib'] + # - os: ubuntu-latest + # arch: ['x86-64', '*.so'] + steps: - name: Check out repository uses: actions/checkout@v4 with: submodules: true + - name: Restore ${{ env.LIBRARY_RELEASE_TAG }} binaries from cache if available id: cache-restore uses: actions/cache@v4 with: - key: ${{ runner.os }}-${{ env.LIBRARY_RELEASE_TAG }} - path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.release-files }} + key: ${{ runner.os }}-${{ matrix.arch[0] }}-${{ env.LIBRARY_RELEASE_TAG }} + path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.arch[1] }} + - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} binaries if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }} uses: robinraju/release-downloader@v1 with: repository: 'NTIA/p2108' tag: ${{ env.LIBRARY_RELEASE_TAG }} - fileName: '${{ matrix.release-files }}' + fileName: '${{ matrix.arch[1] }}' tarBall: false zipBall: false out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} + - name: Set up Python ${{ matrix.py }} uses: actions/setup-python@v5 with: diff --git a/src/ITS/ITU/PSeries/P2108/proplib_loader.py b/src/ITS/ITU/PSeries/P2108/proplib_loader.py index 6859f4c..864ca70 100644 --- a/src/ITS/ITU/PSeries/P2108/proplib_loader.py +++ b/src/ITS/ITU/PSeries/P2108/proplib_loader.py @@ -43,7 +43,6 @@ """ import platform -import struct from ctypes import * from pathlib import Path @@ -72,15 +71,7 @@ def get_lib_name(lib_name: str) -> str: """ # Load the compiled library if platform.uname()[0] == "Windows": - arch = struct.calcsize("P") * 8 # 32 or 64 - if arch == 64: - lib_name += "-x64.dll" - elif arch == 32: - lib_name += "-x86.dll" - else: - raise RuntimeError( - "Failed to determine system architecture for DLL loading" - ) + lib_name += "-x64.dll" elif platform.uname()[0] == "Linux": lib_name += "-x86_64.so" elif platform.uname()[0] == "Darwin": From 52d7a4814b78a652e8385e70e1702b4cb1d89ff3 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:52:54 -0500 Subject: [PATCH 57/83] Use matrix with list of objects to specify platforms --- .github/workflows/tox.yml | 43 ++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index b34e9a5..974bf18 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -30,36 +30,29 @@ env: jobs: run-all-tests: - name: ${{ matrix.os[0] }} (${{ matrix.arch[0] }}) / Py${{ matrix.py }} - runs-on: ${{ matrix.os[1] }} + name: ${{ matrix.platform.os-name }} / Py${{ matrix.py }} + runs-on: ${{ matrix.platform.os-runner }} strategy: fail-fast: false matrix: - os: # OS: ["nicely formatted name", "GitHub runner name"] - - ['Windows', 'windows-latest'] - - ['macOS', 'macos-latest'] - - ['Linux', ubuntu-latest'] - arch: # Architecture: ["name", "file pattern to grab from release"] - - ['x64', '-x64.dll'] # Windows 32-bit - - ['universal', '*.dylib'] # macOS Universal - - ['x86_64', '*.so'] # Linux x86_64 + platform: + - os-name: 'Windows (64-bit)' + os-runner: 'windows-latest' + arch-id: 'x64' + release-file-pattern: '*-x64.dll' + - os-name: 'macOS' + os-runner: 'macos-latest' + arch-id: 'universal' + release-file-pattern: '*.dylib' + - os-name: 'Linux (Ubuntu)' + os-runner: 'ubuntu-latest' + arch-id: 'x86_64' + release-file-pattern: '*.so' py: # Python versions; should exist in pyproject.toml [tool.tox.gh.python] - "3.9" - "3.10" - "3.11" - "3.12" - exclude: # Exclude all matrix combinations - - os: ['Windows', 'windows-latest'] - - os: ['macOS', 'macos-latest'] - - os: ['Linux', ubuntu-latest'] - include: # Selectively include desired OS/architecture combinations - - os: windows-latest - arch: ['x64', '-x64.dll'] - # - os: macos-latest - # arch: ['universal', '*.dylib'] - # - os: ubuntu-latest - # arch: ['x86-64', '*.so'] - steps: - name: Check out repository uses: actions/checkout@v4 @@ -70,8 +63,8 @@ jobs: id: cache-restore uses: actions/cache@v4 with: - key: ${{ runner.os }}-${{ matrix.arch[0] }}-${{ env.LIBRARY_RELEASE_TAG }} - path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.arch[1] }} + key: ${{ runner.os }}-${{ matrix.platform.arch-id }}-${{ env.LIBRARY_RELEASE_TAG }} + path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.platform.release-file-pattern }} - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} binaries if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }} @@ -79,7 +72,7 @@ jobs: with: repository: 'NTIA/p2108' tag: ${{ env.LIBRARY_RELEASE_TAG }} - fileName: '${{ matrix.arch[1] }}' + fileName: '${{ matrix.platform.release-file-pattern }}' tarBall: false zipBall: false out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} From 61f39db94a9684d184760a711797db638946c782 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:54:45 -0500 Subject: [PATCH 58/83] make tests fail for checking CI --- tests/test_p2108.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_p2108.py b/tests/test_p2108.py index 24df67b..45c94a4 100644 --- a/tests/test_p2108.py +++ b/tests/test_p2108.py @@ -42,3 +42,7 @@ def test_TerrestrialStatisticalModel(inputs, rtn, expected): else: with pytest.raises(RuntimeError): P2108.TerrestrialStatisticalModel(*inputs) + + +def test_ShouldFail(): + assert False From 47494eba403f7dd5f4d7b8d465e20fa339aa7edd Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:09:30 -0500 Subject: [PATCH 59/83] Simplify tests with pytest for CI --- .github/workflows/{tox.yml => pytest.yml} | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) rename .github/workflows/{tox.yml => pytest.yml} (82%) diff --git a/.github/workflows/tox.yml b/.github/workflows/pytest.yml similarity index 82% rename from .github/workflows/tox.yml rename to .github/workflows/pytest.yml index 974bf18..290f0bb 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/pytest.yml @@ -82,11 +82,15 @@ jobs: with: python-version: ${{ matrix.py }} cache: 'pip' - - name: Install tox-gh - run: python -m pip install tox-gh - - name: Set up test suite - run: tox r -vv --notest --skip-missing-interpreters false - - name: Run test suite - run: tox r --skip-pkg-install - env: - PYTEST_ADDOPTS: "-vv --durations=0" + - name: Install tox-gh and dependencies + run: python -m pip install .[tests] tox-gh + - name: Force reinstall local package + run: python -m pip install . --force-reinstall + - name: Run pytest + run: pytest --cov-report=term-missing --no-cov-on-fail --cov + # - name: Set up test suite + # run: tox r -vv --notest --skip-missing-interpreters false + # - name: Run test suite + # run: tox r --skip-pkg-install + # env: + # PYTEST_ADDOPTS: "-vv --durations=0" From d76f6be314f0fca8de505d4b4cad2b3a993b1133 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:17:22 -0500 Subject: [PATCH 60/83] Remove tox for CI testing --- .github/workflows/pytest.yml | 19 ++++++++----------- README.md | 4 ++-- pyproject.toml | 24 ------------------------ 3 files changed, 10 insertions(+), 37 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 290f0bb..0b35a38 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,4 +1,4 @@ -name: Tox +name: pytest on: workflow_dispatch: @@ -11,7 +11,7 @@ on: - src - tests - pyproject.toml - - .github\workflows\tox.yml + - .github\workflows\pytest.yml pull_request: branches: - main @@ -48,7 +48,7 @@ jobs: os-runner: 'ubuntu-latest' arch-id: 'x86_64' release-file-pattern: '*.so' - py: # Python versions; should exist in pyproject.toml [tool.tox.gh.python] + py: # Python versions to test - "3.9" - "3.10" - "3.11" @@ -82,15 +82,12 @@ jobs: with: python-version: ${{ matrix.py }} cache: 'pip' - - name: Install tox-gh and dependencies - run: python -m pip install .[tests] tox-gh + + - name: Install dependencies for testing + run: python -m pip install .[tests] + - name: Force reinstall local package run: python -m pip install . --force-reinstall + - name: Run pytest run: pytest --cov-report=term-missing --no-cov-on-fail --cov - # - name: Set up test suite - # run: tox r -vv --notest --skip-missing-interpreters false - # - name: Run test suite - # run: tox r --skip-pkg-install - # env: - # PYTEST_ADDOPTS: "-vv --durations=0" diff --git a/README.md b/README.md index 5ee6ea5..3e403f4 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ [proplib-badge]: https://img.shields.io/badge/PropLib-badge?label=%F0%9F%87%BA%F0%9F%87%B8%20NTIA%2FITS&labelColor=162E51&color=D63E04 [proplib-link]: https://ntia.github.io/propagation-library-wiki -[gh-actions-test-badge]: https://img.shields.io/github/actions/workflow/status/NTIA/p2108-python/tox.yml?branch=main&logo=pytest&logoColor=ffffff&label=Tests&labelColor=162E51 -[gh-actions-test-link]: https://github.com/NTIA/p2108-python/actions/workflows/tox.yml +[gh-actions-test-badge]: https://img.shields.io/github/actions/workflow/status/NTIA/p2108-python/pytest.yml?branch=main&logo=pytest&logoColor=ffffff&label=Tests&labelColor=162E51 +[gh-actions-test-link]: https://github.com/NTIA/p2108-python/actions/workflows/pytest.yml [pypi-release-badge]: https://img.shields.io/pypi/v/proplib-p2108?logo=pypi&logoColor=ffffff&label=Release&labelColor=162E51&color=D63E04 [pypi-release-link]: https://pypi.org/project/proplib-p2108 [gh-issues-badge]: https://img.shields.io/github/issues/NTIA/p2108-python?logo=github&label=Issues&labelColor=162E51 diff --git a/pyproject.toml b/pyproject.toml index deda25f..1925c30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,6 @@ classifiers = [ tests = [ "pytest>=8.2.0,<9.0", "pytest-cov>=6.0.0,<7.0", - "tox>=4.21.1,<5.0", # Keep in sync with tool.tox.min_version ] dev = [ "hatchling>=1.25.0,<2.0", @@ -70,26 +69,3 @@ ignore-vcs = true [tool.cibuildwheel] test-command = "pytest ." test-requires = "pytest" - -[tool.tox] -min_version = "4.21.1" -env_list = ["3.9", "3.10", "3.11", "3.12", "3.13"] -skip_missing_interpreters = true - -[tool.tox.env.testenv] -description = "Run tests with pytest and generate coverage report" -extras = "tests" -commands = [ - "pytest", - "--cov-report=term-missing", - "--no-cov-on-fail", - "--cov", - { replace = "posargs", extend = true }, -] - -[tool.tox.gh.python] # tox-gh config for GitHub Actions testing -"3.9" = ["3.9"] -"3.10" = ["3.10"] -"3.11" = ["3.11"] -"3.12" = ["3.12"] -"3.13" = ["3.13"] From c739bb0ad33b49be8a33cb0b0360605c2e1000c7 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:19:37 -0500 Subject: [PATCH 61/83] Remove debug test designed to always fail --- tests/test_p2108.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/test_p2108.py b/tests/test_p2108.py index 45c94a4..24df67b 100644 --- a/tests/test_p2108.py +++ b/tests/test_p2108.py @@ -42,7 +42,3 @@ def test_TerrestrialStatisticalModel(inputs, rtn, expected): else: with pytest.raises(RuntimeError): P2108.TerrestrialStatisticalModel(*inputs) - - -def test_ShouldFail(): - assert False From 6e5fbb379739754b3d6882b4b7180f4e58f5e27b Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:21:30 -0500 Subject: [PATCH 62/83] Remove path filters --- .github/workflows/pytest.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 0b35a38..d384b56 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -5,20 +5,11 @@ on: push: branches: - main - - dev - pre-publish-revisions # TESTING - paths: - - src - - tests - - pyproject.toml - - .github\workflows\pytest.yml pull_request: branches: - main - paths: - - src - - tests - - pyproject.toml + - dev concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} From 6dfd6d529c288aeb3f09d1f0191019b7d210db05 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:24:10 -0500 Subject: [PATCH 63/83] Remove dead code --- tests/test_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index 258e994..73b9392 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -7,7 +7,6 @@ # Check if test data directory exists and is not empty if not TEST_DATA_DIR.exists() or not any(TEST_DATA_DIR.iterdir()): - _test_data_checked = True raise RuntimeError( f"Test data is not available in {TEST_DATA_DIR}.\n Try running " + "`git submodule init` and `git submodule update` to clone the test data submodule." From 2cb8b31febfe4b3caad023bc50b71102f89863ba Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:28:07 -0500 Subject: [PATCH 64/83] Try single download step --- .github/workflows/pytest.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d384b56..9cecd6d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,4 +1,4 @@ -name: pytest +name: Test with pytest on: workflow_dispatch: @@ -16,6 +16,7 @@ concurrency: cancel-in-progress: true env: + LIBRARY_BASE_REPO: NTIA/p2108 LIBRARY_RELEASE_TAG: v1.0-rc.1 LIBRARY_DESTINATION_DIRECTORY: 'src/ITS/ITU/PSeries/P2108/' @@ -50,20 +51,19 @@ jobs: with: submodules: true - - name: Restore ${{ env.LIBRARY_RELEASE_TAG }} binaries from cache if available - id: cache-restore - uses: actions/cache@v4 - with: - key: ${{ runner.os }}-${{ matrix.platform.arch-id }}-${{ env.LIBRARY_RELEASE_TAG }} - path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.platform.release-file-pattern }} + # - name: Restore ${{ env.LIBRARY_RELEASE_TAG }} binaries from cache if available + # id: cache-restore + # uses: actions/cache@v4 + # with: + # key: ${{ runner.os }}-${{ matrix.platform.arch-id }}-${{ env.LIBRARY_RELEASE_TAG }} + # path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.platform.release-file-pattern }} - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} binaries - if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }} uses: robinraju/release-downloader@v1 with: - repository: 'NTIA/p2108' + repository: ${{ env.LIBRARY_BASE_REPO }} tag: ${{ env.LIBRARY_RELEASE_TAG }} - fileName: '${{ matrix.platform.release-file-pattern }}' + fileName: '*.dll,*.so,*.dylib' tarBall: false zipBall: false out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} From 728d27049ca34b2f11115d2f7d7d00f8a542adfb Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:29:03 -0500 Subject: [PATCH 65/83] Remove a step by using editable pip install --- .github/workflows/pytest.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 9cecd6d..f449042 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -75,10 +75,7 @@ jobs: cache: 'pip' - name: Install dependencies for testing - run: python -m pip install .[tests] - - - name: Force reinstall local package - run: python -m pip install . --force-reinstall + run: python -m pip install -e .[tests] - name: Run pytest run: pytest --cov-report=term-missing --no-cov-on-fail --cov From 0b175f297cda52036fcd5d1834a9c32489f8028b Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:35:08 -0500 Subject: [PATCH 66/83] Revert to previous download strategy --- .github/workflows/pytest.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f449042..d54e31c 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -5,7 +5,6 @@ on: push: branches: - main - - pre-publish-revisions # TESTING pull_request: branches: - main @@ -51,19 +50,22 @@ jobs: with: submodules: true - # - name: Restore ${{ env.LIBRARY_RELEASE_TAG }} binaries from cache if available - # id: cache-restore - # uses: actions/cache@v4 - # with: - # key: ${{ runner.os }}-${{ matrix.platform.arch-id }}-${{ env.LIBRARY_RELEASE_TAG }} - # path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.platform.release-file-pattern }} + - name: Restore ${{ env.LIBRARY_RELEASE_TAG }} binaries from cache if available + id: cache-restore + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-${{ matrix.platform.arch-id }}-${{ env.LIBRARY_RELEASE_TAG }} + path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.platform.release-file-pattern }} + # Only the binaries required for the current platform are downloaded. Note that the distributed + # wheel for proplib python packages includes all binaries, so that the wheel is inherently cross-platform. - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} binaries + if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }} uses: robinraju/release-downloader@v1 with: repository: ${{ env.LIBRARY_BASE_REPO }} tag: ${{ env.LIBRARY_RELEASE_TAG }} - fileName: '*.dll,*.so,*.dylib' + fileName: ${{ matrix.platform.release-file-pattern }} tarBall: false zipBall: false out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} From 306b57396dcd3bdacbbb8978c4b7b79a02038869 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:38:01 -0500 Subject: [PATCH 67/83] Add matrix config to test 32-bit windows --- .github/workflows/pytest.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d54e31c..7bb5de1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -31,13 +31,17 @@ jobs: os-runner: 'windows-latest' arch-id: 'x64' release-file-pattern: '*-x64.dll' + - os-name: 'Windows (32-bit)' + os-runner: 'windows-latest' + arch-id: 'x86' + release-file-pattern: '*-x86.dll' - os-name: 'macOS' os-runner: 'macos-latest' - arch-id: 'universal' + arch-id: 'arm64' release-file-pattern: '*.dylib' - os-name: 'Linux (Ubuntu)' os-runner: 'ubuntu-latest' - arch-id: 'x86_64' + arch-id: 'x64' release-file-pattern: '*.so' py: # Python versions to test - "3.9" @@ -50,6 +54,7 @@ jobs: with: submodules: true + # Cache key is unique to the combination of runner OS + architecture (matrix.arch-id) + release tag - name: Restore ${{ env.LIBRARY_RELEASE_TAG }} binaries from cache if available id: cache-restore uses: actions/cache@v4 @@ -73,6 +78,7 @@ jobs: - name: Set up Python ${{ matrix.py }} uses: actions/setup-python@v5 with: + architecture: ${{ matrix.platform.arch-id }} python-version: ${{ matrix.py }} cache: 'pip' From 6654b4a0156d9e81b115b732a5086e4e6c4de039 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:41:15 -0500 Subject: [PATCH 68/83] Add DLL loading logic for 32-bit windows --- src/ITS/ITU/PSeries/P2108/proplib_loader.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ITS/ITU/PSeries/P2108/proplib_loader.py b/src/ITS/ITU/PSeries/P2108/proplib_loader.py index 864ca70..6859f4c 100644 --- a/src/ITS/ITU/PSeries/P2108/proplib_loader.py +++ b/src/ITS/ITU/PSeries/P2108/proplib_loader.py @@ -43,6 +43,7 @@ """ import platform +import struct from ctypes import * from pathlib import Path @@ -71,7 +72,15 @@ def get_lib_name(lib_name: str) -> str: """ # Load the compiled library if platform.uname()[0] == "Windows": - lib_name += "-x64.dll" + arch = struct.calcsize("P") * 8 # 32 or 64 + if arch == 64: + lib_name += "-x64.dll" + elif arch == 32: + lib_name += "-x86.dll" + else: + raise RuntimeError( + "Failed to determine system architecture for DLL loading" + ) elif platform.uname()[0] == "Linux": lib_name += "-x86_64.so" elif platform.uname()[0] == "Darwin": From 61ed0aebd1517573c9fcdbae70b594c86fd36fa2 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:42:15 -0500 Subject: [PATCH 69/83] Add docstring about new possible error --- src/ITS/ITU/PSeries/P2108/proplib_loader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ITS/ITU/PSeries/P2108/proplib_loader.py b/src/ITS/ITU/PSeries/P2108/proplib_loader.py index 6859f4c..21702e3 100644 --- a/src/ITS/ITU/PSeries/P2108/proplib_loader.py +++ b/src/ITS/ITU/PSeries/P2108/proplib_loader.py @@ -68,6 +68,7 @@ def get_lib_name(lib_name: str) -> str: :param lib_name: The library name, with no extension or path, e.g., "P2108-1.0" :raises NotImplementedError: For platforms other than Windows, Linux, or macOS. + :raises RuntimeError: On Windows, if unable to determine system architecture. :return: The full filename, including path and extension, of the library. """ # Load the compiled library From f264487273a74bd420de5acb4d24a34f0124d357 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:42:44 -0500 Subject: [PATCH 70/83] Add testing workflows for intel-based mac platforms --- .github/workflows/pytest.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 7bb5de1..a3448d1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -35,7 +35,11 @@ jobs: os-runner: 'windows-latest' arch-id: 'x86' release-file-pattern: '*-x86.dll' - - os-name: 'macOS' + - os-name: 'macOS (intel/x64)' + os-runner: 'macos-13' + arch-id: 'x64' + release-file-pattern: '*.dylib' + - os-name: 'macOS (apple/arm64)' os-runner: 'macos-latest' arch-id: 'arm64' release-file-pattern: '*.dylib' From 8cfc2e9da9f871f365f485211657d62b746b8609 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:51:56 -0500 Subject: [PATCH 71/83] Add pytest GitHub Actions workflow --- .github/workflows/pytest.yml | 97 ++++++++++++++++++++++++++++++++++++ README.md | 6 +-- pyproject.toml | 24 --------- 3 files changed, 100 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..018e1a4 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,97 @@ +name: Test with pytest + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: + - main + - dev + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +# TODO-TEMPLATE: Populate environment variables below +# LIBRARY_BASE_REPO: The base repo with the C++ implementation, e.g. "NTIA/itm" +# LIBRARY_RELEASE_TAG: The Git tag identifying a release. Can be a pre-release. +# LIBRARY_DESTINATION_DIRECTORY: Path in this repo where shared library files should be placed +env: + LIBRARY_BASE_REPO: NTIA/proplib-template + LIBRARY_RELEASE_TAG: v1.0 + LIBRARY_DESTINATION_DIRECTORY: 'src/ITS/PropLibTemplate/' + +jobs: + run-all-tests: + name: ${{ matrix.platform.os-name }} / Py${{ matrix.py }} + runs-on: ${{ matrix.platform.os-runner }} + strategy: + fail-fast: false + matrix: + platform: + - os-name: 'Windows (64-bit)' + os-runner: 'windows-latest' + arch-id: 'x64' + release-file-pattern: '*-x64.dll' + - os-name: 'Windows (32-bit)' + os-runner: 'windows-latest' + arch-id: 'x86' + release-file-pattern: '*-x86.dll' + - os-name: 'macOS (intel/x64)' + os-runner: 'macos-13' + arch-id: 'x64' + release-file-pattern: '*.dylib' + - os-name: 'macOS (apple/arm64)' + os-runner: 'macos-latest' + arch-id: 'arm64' + release-file-pattern: '*.dylib' + - os-name: 'Linux (Ubuntu)' + os-runner: 'ubuntu-latest' + arch-id: 'x64' + release-file-pattern: '*.so' + py: # Python versions to test on all platforms + - "3.9" + - "3.10" + - "3.11" + - "3.12" + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + submodules: true + + # Cache key is unique to the combination of runner OS + architecture (matrix.arch-id) + release tag + - name: Restore ${{ env.LIBRARY_RELEASE_TAG }} binaries from cache if available + id: cache-restore + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-${{ matrix.platform.arch-id }}-${{ env.LIBRARY_RELEASE_TAG }} + path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.platform.release-file-pattern }} + + # Only the binaries required for the current platform are downloaded. Note that the distributed + # wheel for proplib python packages includes all binaries, so that the wheel is inherently cross-platform. + - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} binaries + if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }} + uses: robinraju/release-downloader@v1 + with: + repository: ${{ env.LIBRARY_BASE_REPO }} + tag: ${{ env.LIBRARY_RELEASE_TAG }} + fileName: ${{ matrix.platform.release-file-pattern }} + tarBall: false + zipBall: false + out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} + + - name: Set up Python ${{ matrix.py }} + uses: actions/setup-python@v5 + with: + architecture: ${{ matrix.platform.arch-id }} + python-version: ${{ matrix.py }} + cache: 'pip' + + - name: Install dependencies for testing + run: python -m pip install -e .[tests] + + - name: Run pytest + run: pytest --cov-report=term-missing --no-cov-on-fail --cov diff --git a/README.md b/README.md index 5d4b25c..fa7d571 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - Make sure to update the [pypi-release-badge] and [pypi-release-link] URLs with your package name on PyPI (NOT the repository name on GitHub!) - This can only be added once there is a published version of the package on PyPI -- The third badge is the Tox GitHub actions status. +- The third badge is the pytest GitHub actions status. - Update the repository name in [gh-actions-test-badge] and [gh-actions-test-link] - The fourth badge displays open GitHub Issues - Update the repository name in [gh-issues-badge] @@ -27,8 +27,8 @@ --> [proplib-badge]: https://img.shields.io/badge/PropLib-badge?label=%F0%9F%87%BA%F0%9F%87%B8%20NTIA%2FITS&labelColor=162E51&color=D63E04 [proplib-link]: https://ntia.github.io/propagation-library-wiki -[gh-actions-test-badge]: https://img.shields.io/github/actions/workflow/status/NTIA/TODO-TEMPLATE/tox.yml?branch=main&logo=pytest&logoColor=ffffff&label=Tests&labelColor=162E51 -[gh-actions-test-link]: https://github.com/NTIA/TODO-TEMPLATE/actions/workflows/tox.yml +[gh-actions-test-badge]: https://img.shields.io/github/actions/workflow/status/NTIA/TODO-TEMPLATE/pytest.yml?branch=main&logo=pytest&logoColor=ffffff&label=Tests&labelColor=162E51 +[gh-actions-test-link]: https://github.com/NTIA/TODO-TEMPLATE/actions/workflows/pytest.yml [pypi-release-badge]: https://img.shields.io/pypi/v/TODO-TEMPLATE?logo=pypi&logoColor=ffffff&label=Release&labelColor=162E51&color=D63E04 [pypi-release-link]: https://pypi.org/project/TODO-TEMPLATE [gh-issues-badge]: https://img.shields.io/github/issues/NTIA/TODO-TEMPLATE?logo=github&label=Issues&labelColor=162E51 diff --git a/pyproject.toml b/pyproject.toml index 454ad32..2a84cb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,6 @@ classifiers = [ tests = [ "pytest>=8.2.0,<9.0", "pytest-cov>=6.0.0,<7.0", - "tox>=4.21.1,<5.0", # Keep in sync with tool.tox.min_version ] dev = [ "hatchling>=1.25.0,<2.0", @@ -64,26 +63,3 @@ ignore-vcs = true [tool.cibuildwheel] test-command = "pytest ." test-requires = "pytest" - -[tool.tox] -min_version = "4.21.1" -env_list = ["3.9", "3.10", "3.11", "3.12", "3.13"] -skip_missing_interpreters = true # TODO override this in GHA - -[tool.tox.env.testenv] -description = "Run tests with pytest and generate coverage report" -extras = "tests" -commands = [ - "pytest", - "--cov-report=term-missing", - "--no-cov-on-fail", - "--cov", - { replace = "posargs", extend = true }, -] - -[tool.tox.gh.python] # tox-gh config for GitHub Actions testing -"3.9" = ["3.9"] -"3.10" = ["3.10"] -"3.11" = ["3.11"] -"3.12" = ["3.12"] -"3.13" = ["3.13"] From a9cb4fe64e32956fa6ee3152cdd783f652f086d8 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:54:44 -0500 Subject: [PATCH 72/83] Support 32-bit windows --- src/ITS/PropLibTemplate/proplib_loader.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ITS/PropLibTemplate/proplib_loader.py b/src/ITS/PropLibTemplate/proplib_loader.py index ff8312d..72e3dfc 100644 --- a/src/ITS/PropLibTemplate/proplib_loader.py +++ b/src/ITS/PropLibTemplate/proplib_loader.py @@ -43,6 +43,7 @@ """ import platform +import struct from ctypes import * from pathlib import Path @@ -71,7 +72,15 @@ def get_lib_name(lib_name: str) -> str: """ # Load the compiled library if platform.uname()[0] == "Windows": - lib_name += ".dll" + arch = struct.calcsize("P") * 8 # 32 or 64 + if arch == 64: + lib_name += "-x64.dll" + elif arch == 32: + lib_name += "-x86.dll" + else: + raise RuntimeError( + "Failed to determine system architecture for DLL loading" + ) elif platform.uname()[0] == "Linux": lib_name += ".so" elif platform.uname()[0] == "Darwin": From 84e80d697121ab54532ba2830539f4ca4ad43fad Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:58:39 -0500 Subject: [PATCH 73/83] Remove __all__ in package root, add check for test data --- src/ITS/PropLibTemplate/__init__.py | 3 --- tests/test_utils.py | 10 +++++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ITS/PropLibTemplate/__init__.py b/src/ITS/PropLibTemplate/__init__.py index 9145e88..98e008e 100644 --- a/src/ITS/PropLibTemplate/__init__.py +++ b/src/ITS/PropLibTemplate/__init__.py @@ -6,6 +6,3 @@ # from .proplib_template import ( # ) - -# TODO-TEMPLATE: Put the name of the module here -__all__ = ["proplib_template"] diff --git a/tests/test_utils.py b/tests/test_utils.py index 4a6a2ce..a107003 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -2,9 +2,17 @@ from pathlib import Path # Test data is expected to exist in tests/data -TEST_DATA_DIR = Path(__file__).parent / "data" +# TODO-TEMPLATE: Remove the '#' in the line below after adding your test data submodule +TEST_DATA_DIR = Path(__file__).parent # / "data" ABSTOL__DB = 0.1 # Absolute tolerance, in dB, to ensure outputs match expected value +# Check if test data directory exists and is not empty +if not TEST_DATA_DIR.exists() or not any(TEST_DATA_DIR.iterdir()): + raise RuntimeError( + f"Test data is not available in {TEST_DATA_DIR}.\n Try running " + + "`git submodule init` and `git submodule update` to clone the test data submodule." + ) + # TODO-TEMPLATE: Update CSV reader based on test data CSV structure def read_csv_test_data(filename: str): From 047a85ed5313d3c04b88ee21137906713f7954d7 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 17:01:38 -0500 Subject: [PATCH 74/83] Remove template comment --- tests/test_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index 275021a..73b9392 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -2,8 +2,7 @@ from pathlib import Path # Test data is expected to exist in tests/data -# TODO-TEMPLATE: Remove the '#' in the line below after adding your test data submodule -TEST_DATA_DIR = Path(__file__).parent # / "data" +TEST_DATA_DIR = Path(__file__).parent / "data" ABSTOL__DB = 0.1 # Absolute tolerance, in dB, to ensure outputs match expected value # Check if test data directory exists and is not empty From 0fc2662b401976add6c959a65d6d21ff697b0d22 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Fri, 17 Jan 2025 17:39:29 -0500 Subject: [PATCH 75/83] Testing buildwheel action --- .github/workflows/buildwheels.yml | 74 +++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/buildwheels.yml diff --git a/.github/workflows/buildwheels.yml b/.github/workflows/buildwheels.yml new file mode 100644 index 0000000..0047ed3 --- /dev/null +++ b/.github/workflows/buildwheels.yml @@ -0,0 +1,74 @@ +name: Build Wheels + +on: [push] # TODO + +env: + LIBRARY_BASE_REPO: NTIA/p2108 + LIBRARY_RELEASE_TAG: v1.0-rc.1 + LIBRARY_DESTINATION_DIRECTORY: 'src/ITS/ITU/PSeries/P2108/' + +jobs: + build_wheels: + name: Build a universal, cross-platform wheel + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + submodules: true + + # Only the binaries required for the current platform are downloaded. Note that the distributed + # wheel for proplib python packages includes all binaries, so that the wheel is inherently cross-platform. + - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} Windows binaries + uses: robinraju/release-downloader@v1 + with: + repository: ${{ env.LIBRARY_BASE_REPO }} + tag: ${{ env.LIBRARY_RELEASE_TAG }} + fileName: '*.dll' + tarBall: false + zipBall: false + out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} + + - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} Linux binaries + uses: robinraju/release-downloader@v1 + with: + repository: ${{ env.LIBRARY_BASE_REPO }} + tag: ${{ env.LIBRARY_RELEASE_TAG }} + fileName: '*.so' + tarBall: false + zipBall: false + out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} + + - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} macOS binaries + uses: robinraju/release-downloader@v1 + with: + repository: ${{ env.LIBRARY_BASE_REPO }} + tag: ${{ env.LIBRARY_RELEASE_TAG }} + fileName: '*.dylib' + tarBall: false + zipBall: false + out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + + - name: Install build dependencies + run: pip install hatchling + + - name: Build wheels + run: hatchling build + + - name: List files in subdir (DEBUG) + run: ls + working-directory: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} + + - name: List files in subdir (DEBUG) + run: ls + working-directory: dist + + - uses: actions/upload-artifact@v4 + with: + name: Universal Wheel (.whl) + path: dist/*.whl From 8b5fbf099ab66311fdee18422c83a3a2a13bbbef Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:25:03 -0500 Subject: [PATCH 76/83] Add tests for wheel being built --- .github/workflows/buildwheels.yml | 57 ++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildwheels.yml b/.github/workflows/buildwheels.yml index 0047ed3..d1fadcd 100644 --- a/.github/workflows/buildwheels.yml +++ b/.github/workflows/buildwheels.yml @@ -8,7 +8,7 @@ env: LIBRARY_DESTINATION_DIRECTORY: 'src/ITS/ITU/PSeries/P2108/' jobs: - build_wheels: + build_wheel: name: Build a universal, cross-platform wheel runs-on: ubuntu-latest steps: @@ -72,3 +72,58 @@ jobs: with: name: Universal Wheel (.whl) path: dist/*.whl + test_wheel: + name: Test wheel / ${{ matrix.platform.os-name }} + needs: build_wheel + runs-on: ${{ matrix.platform.os-runner }} + strategy: + matrix: + platform: + - os-name: 'Windows (64-bit)' + os-runner: 'windows-latest' + arch-id: 'x64' + release-file-pattern: '*-x64.dll' + - os-name: 'Windows (32-bit)' + os-runner: 'windows-latest' + arch-id: 'x86' + release-file-pattern: '*-x86.dll' + - os-name: 'macOS (intel/x64)' + os-runner: 'macos-13' + arch-id: 'x64' + release-file-pattern: '*.dylib' + - os-name: 'macOS (apple/arm64)' + os-runner: 'macos-latest' + arch-id: 'arm64' + release-file-pattern: '*.dylib' + - os-name: 'Linux (Ubuntu)' + os-runner: 'ubuntu-latest' + arch-id: 'x64' + release-file-pattern: '*.so' + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + submodules: true + + - name: Download wheel + id: wheel-artifact-download + uses: actions/download-artifact@v4 + + - name: Set up Python ${{ matrix.py }} + uses: actions/setup-python@v5 + with: + architecture: ${{ matrix.platform.arch-id }} + python-version: ${{ matrix.py }} + cache: 'pip' + + - name: Install dependencies for testing + run: python -m pip install .[tests] + + - name: Remove source directory # make sure we are testing the wheel, not the cloned package + run: rm -r ./src + + - name: Install newly-built wheel + run: python -m pip install ${{ steps.wheel-artifact-download.outputs.download-path }}/*.whl --force-reinstall + + - name: Run pytest + run: pytest --cov-report=term-missing --no-cov-on-fail --cov From 6cb177950e113203ce34865df8fdc17e11f0e308 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:49:04 -0500 Subject: [PATCH 77/83] debug download artifact filepath --- .github/workflows/buildwheels.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/buildwheels.yml b/.github/workflows/buildwheels.yml index d1fadcd..eda793f 100644 --- a/.github/workflows/buildwheels.yml +++ b/.github/workflows/buildwheels.yml @@ -60,14 +60,6 @@ jobs: - name: Build wheels run: hatchling build - - name: List files in subdir (DEBUG) - run: ls - working-directory: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} - - - name: List files in subdir (DEBUG) - run: ls - working-directory: dist - - uses: actions/upload-artifact@v4 with: name: Universal Wheel (.whl) @@ -109,6 +101,9 @@ jobs: id: wheel-artifact-download uses: actions/download-artifact@v4 + - name: debug list files + run: ls ${{ steps.wheel-artifact-download.outputs.download-path }}/* + - name: Set up Python ${{ matrix.py }} uses: actions/setup-python@v5 with: @@ -123,7 +118,7 @@ jobs: run: rm -r ./src - name: Install newly-built wheel - run: python -m pip install ${{ steps.wheel-artifact-download.outputs.download-path }}/*.whl --force-reinstall + run: python -m pip install ${{ steps.wheel-artifact-download.outputs.download-path }}/*/*.whl --force-reinstall - name: Run pytest run: pytest --cov-report=term-missing --no-cov-on-fail --cov From 77423548f0bc741cebca0af7843aa0f326d60516 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:56:27 -0500 Subject: [PATCH 78/83] Adjust file paths for multi-platform --- .github/workflows/buildwheels.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/buildwheels.yml b/.github/workflows/buildwheels.yml index eda793f..f3ea6a3 100644 --- a/.github/workflows/buildwheels.yml +++ b/.github/workflows/buildwheels.yml @@ -62,7 +62,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: Universal Wheel (.whl) + name: universal-wheel path: dist/*.whl test_wheel: name: Test wheel / ${{ matrix.platform.os-name }} @@ -98,17 +98,17 @@ jobs: submodules: true - name: Download wheel - id: wheel-artifact-download + id: wheel-download uses: actions/download-artifact@v4 - name: debug list files - run: ls ${{ steps.wheel-artifact-download.outputs.download-path }}/* + run: ls ${{ steps.wheel-download.outputs.download-path }}/universal-wheel/* - - name: Set up Python ${{ matrix.py }} + - name: Set up Python uses: actions/setup-python@v5 with: architecture: ${{ matrix.platform.arch-id }} - python-version: ${{ matrix.py }} + python-version: '>=3.9 <3.14' cache: 'pip' - name: Install dependencies for testing @@ -117,8 +117,16 @@ jobs: - name: Remove source directory # make sure we are testing the wheel, not the cloned package run: rm -r ./src - - name: Install newly-built wheel - run: python -m pip install ${{ steps.wheel-artifact-download.outputs.download-path }}/*/*.whl --force-reinstall + - name: debug list files + run: ls ${{ steps.wheel-download.outputs.download-path }}/* + + - name: Install newly-built wheel (macOS/Linux) + if: ${{ runner.os != 'Windows'}} + run: python -m pip install ${{ steps.wheel-download.outputs.download-path }}/universal-wheel/*.whl --force-reinstall + + - name: Install newly-built wheel (Windows) + if: ${{ runner.os == 'Windows'}} + run: python -m pip install ${{ steps.wheel-download.outputs.download-path }}\universal-wheel\*.whl --force-reinstall - name: Run pytest run: pytest --cov-report=term-missing --no-cov-on-fail --cov From 2bbf467cd5f433f12edfcd3963755ee6f32eb465 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:59:18 -0500 Subject: [PATCH 79/83] Update cff-validator to v4 --- .github/workflows/cff-validator.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/cff-validator.yml b/.github/workflows/cff-validator.yml index 27c0abc..598eaed 100644 --- a/.github/workflows/cff-validator.yml +++ b/.github/workflows/cff-validator.yml @@ -24,6 +24,4 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Validate CITATION.cff - uses: dieghernan/cff-validator@v3 - with: - install-r: true + uses: dieghernan/cff-validator@v4 From 9c5d2caeb68a3eb6a7f2c601aa2d5a0e497027af Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:16:10 -0500 Subject: [PATCH 80/83] Remove testing code --- .github/workflows/buildwheels.yml | 86 +++++++------------------------ 1 file changed, 18 insertions(+), 68 deletions(-) diff --git a/.github/workflows/buildwheels.yml b/.github/workflows/buildwheels.yml index f3ea6a3..a376267 100644 --- a/.github/workflows/buildwheels.yml +++ b/.github/workflows/buildwheels.yml @@ -1,6 +1,22 @@ +# Action builds a universal (Win32/Win64/macOS-universal/Linux-x64) Python wheel +# from the source code, using Hatchling, and uploads it as an artifact. This wheel +# can then be distributed with new releases. The action is triggered by pushes into `main` +# or pull_requests into `main` or `dev` (for testing). To aid in releases, the workflow is +# also triggered when new SemVer tags are created. This action handles downloading all +# shared library files and including them in the resulting wheel. name: Build Wheels -on: [push] # TODO +on: + workflow_dispatch: + push: + branches: + - main + tags: + - 'v[0-9]+.*' + pull_request: + branches: + - main + - dev env: LIBRARY_BASE_REPO: NTIA/p2108 @@ -62,71 +78,5 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: universal-wheel + name: Universal Wheel (.whl) path: dist/*.whl - test_wheel: - name: Test wheel / ${{ matrix.platform.os-name }} - needs: build_wheel - runs-on: ${{ matrix.platform.os-runner }} - strategy: - matrix: - platform: - - os-name: 'Windows (64-bit)' - os-runner: 'windows-latest' - arch-id: 'x64' - release-file-pattern: '*-x64.dll' - - os-name: 'Windows (32-bit)' - os-runner: 'windows-latest' - arch-id: 'x86' - release-file-pattern: '*-x86.dll' - - os-name: 'macOS (intel/x64)' - os-runner: 'macos-13' - arch-id: 'x64' - release-file-pattern: '*.dylib' - - os-name: 'macOS (apple/arm64)' - os-runner: 'macos-latest' - arch-id: 'arm64' - release-file-pattern: '*.dylib' - - os-name: 'Linux (Ubuntu)' - os-runner: 'ubuntu-latest' - arch-id: 'x64' - release-file-pattern: '*.so' - steps: - - name: Check out repository - uses: actions/checkout@v4 - with: - submodules: true - - - name: Download wheel - id: wheel-download - uses: actions/download-artifact@v4 - - - name: debug list files - run: ls ${{ steps.wheel-download.outputs.download-path }}/universal-wheel/* - - - name: Set up Python - uses: actions/setup-python@v5 - with: - architecture: ${{ matrix.platform.arch-id }} - python-version: '>=3.9 <3.14' - cache: 'pip' - - - name: Install dependencies for testing - run: python -m pip install .[tests] - - - name: Remove source directory # make sure we are testing the wheel, not the cloned package - run: rm -r ./src - - - name: debug list files - run: ls ${{ steps.wheel-download.outputs.download-path }}/* - - - name: Install newly-built wheel (macOS/Linux) - if: ${{ runner.os != 'Windows'}} - run: python -m pip install ${{ steps.wheel-download.outputs.download-path }}/universal-wheel/*.whl --force-reinstall - - - name: Install newly-built wheel (Windows) - if: ${{ runner.os == 'Windows'}} - run: python -m pip install ${{ steps.wheel-download.outputs.download-path }}\universal-wheel\*.whl --force-reinstall - - - name: Run pytest - run: pytest --cov-report=term-missing --no-cov-on-fail --cov From 78facd1953a0411407c77a9f038718b96a244ce3 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:17:51 -0500 Subject: [PATCH 81/83] Update cff-validator to v4 --- .github/workflows/cff-validator.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/cff-validator.yml b/.github/workflows/cff-validator.yml index 27c0abc..598eaed 100644 --- a/.github/workflows/cff-validator.yml +++ b/.github/workflows/cff-validator.yml @@ -24,6 +24,4 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Validate CITATION.cff - uses: dieghernan/cff-validator@v3 - with: - install-r: true + uses: dieghernan/cff-validator@v4 From ece190a066455da2347fac899292f263515d6773 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:18:12 -0500 Subject: [PATCH 82/83] Add buildwheels template workflow --- .github/workflows/buildwheels.yml | 86 +++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/buildwheels.yml diff --git a/.github/workflows/buildwheels.yml b/.github/workflows/buildwheels.yml new file mode 100644 index 0000000..9266878 --- /dev/null +++ b/.github/workflows/buildwheels.yml @@ -0,0 +1,86 @@ +# Action builds a universal (Win32/Win64/macOS-universal/Linux-x64) Python wheel +# from the source code, using Hatchling, and uploads it as an artifact. This wheel +# can then be distributed with new releases. The action is triggered by pushes into `main` +# or pull_requests into `main` or `dev` (for testing). To aid in releases, the workflow is +# also triggered when new SemVer tags are created. This action handles downloading all +# shared library files and including them in the resulting wheel. +name: Build Wheels + +on: + workflow_dispatch: + push: + branches: + - main + tags: + - 'v[0-9]+.*' + pull_request: + branches: + - main + - dev + +# TODO-TEMPLATE: Populate environment variables below +# LIBRARY_BASE_REPO: The base repo with the C++ implementation, e.g. "NTIA/itm" +# LIBRARY_RELEASE_TAG: The Git tag identifying a release. Can be a pre-release. +# LIBRARY_DESTINATION_DIRECTORY: Path in this repo where shared library files should be placed +env: + LIBRARY_BASE_REPO: NTIA/proplib-template + LIBRARY_RELEASE_TAG: v1.0 + LIBRARY_DESTINATION_DIRECTORY: 'src/ITS/PropLibTemplate/' + +jobs: + build_wheel: + name: Build a universal, cross-platform wheel + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + submodules: true + + # Only the binaries required for the current platform are downloaded. Note that the distributed + # wheel for proplib python packages includes all binaries, so that the wheel is inherently cross-platform. + - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} Windows binaries + uses: robinraju/release-downloader@v1 + with: + repository: ${{ env.LIBRARY_BASE_REPO }} + tag: ${{ env.LIBRARY_RELEASE_TAG }} + fileName: '*.dll' + tarBall: false + zipBall: false + out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} + + - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} Linux binaries + uses: robinraju/release-downloader@v1 + with: + repository: ${{ env.LIBRARY_BASE_REPO }} + tag: ${{ env.LIBRARY_RELEASE_TAG }} + fileName: '*.so' + tarBall: false + zipBall: false + out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} + + - name: Download required ${{ env.LIBRARY_RELEASE_TAG }} macOS binaries + uses: robinraju/release-downloader@v1 + with: + repository: ${{ env.LIBRARY_BASE_REPO }} + tag: ${{ env.LIBRARY_RELEASE_TAG }} + fileName: '*.dylib' + tarBall: false + zipBall: false + out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + + - name: Install build dependencies + run: pip install hatchling + + - name: Build wheels + run: hatchling build + + - uses: actions/upload-artifact@v4 + with: + name: Universal Wheel (.whl) + path: dist/*.whl From 1414e6cdcfd6c3e3acdfa9a42c4c62cfdd4014c3 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:18:39 -0500 Subject: [PATCH 83/83] Add runtimeerror documentation --- src/ITS/PropLibTemplate/proplib_loader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ITS/PropLibTemplate/proplib_loader.py b/src/ITS/PropLibTemplate/proplib_loader.py index 72e3dfc..bd3087e 100644 --- a/src/ITS/PropLibTemplate/proplib_loader.py +++ b/src/ITS/PropLibTemplate/proplib_loader.py @@ -68,6 +68,7 @@ def get_lib_name(lib_name: str) -> str: :param lib_name: The library name, with no extension or path, e.g., "P2108-1.0" :raises NotImplementedError: For platforms other than Windows, Linux, or macOS. + :raises RuntimeError: On Windows, if unable to determine system architecture. :return: The full filename, including path and extension, of the library. """ # Load the compiled library