diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0edabf0..039641e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,3 @@ * @dylanm-ansys * @lukequeenan-ansys * @gregbaethge -* @ansys-internal/pyansys-core \ No newline at end of file diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 3005073..4477a90 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -6,8 +6,6 @@ on: env: MAIN_PYTHON_VERSION: '3.13' LIBRARY_NAME: 'ansys-lumerical-core' - DOCKER_IMAGE_LUMERICAL_UNIFIED: 'ghcr.io/ansys-internal/lumerical-unified:v252_3' - DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified' PIP_EXTRA_INDEX_URL: 'https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/' DOCUMENTATION_CNAME: 'lumerical.docs.pyansys.com' @@ -21,6 +19,16 @@ concurrency: jobs: + actions-security: + name: "Actions Security" + runs-on: ubuntu-latest + steps: + - uses: ansys/actions/check-actions-security@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4 + with: + generate-summary: true + token: ${{ secrets.GITHUB_TOKEN }} + auditing-level: "high" + # vulnerabilities: # name: Vulnerabilities # runs-on: ubuntu-latest @@ -33,6 +41,21 @@ jobs: # python-package-name: ${{ env.LIBRARY_NAME }} # token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} # dev-mode: ${{ github.ref != 'refs/heads/main' }} + + update-changelog: + name: "Update CHANGELOG (on release)" + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: ansys/actions/doc-deploy-changelog@v10.1 + with: + bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} + bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + labeler: name: "Labels" permissions: @@ -40,17 +63,14 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - name: "Checkout project" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - - name: "Sync labels" uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: "Label pull-request" # HACK: skip if contributor does not have write permissions (forks) if: github.event.pull_request.head.repo.full_name == github.repository @@ -85,6 +105,14 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} use-python-cache: false + commit-style: + name: "Run commit style checks" + runs-on: ubuntu-latest + steps: + - uses: ansys/actions/check-pr-title@v10.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + doc-style: name: "Doc style" runs-on: ubuntu-latest @@ -147,10 +175,15 @@ jobs: permissions: id-token: write contents: write + env: + DOCKER_IMAGE_LUMERICAL_UNIFIED: 'ghcr.io/ansys-internal/lumerical-unified:v252_3' + DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified' steps: - name: "Checkout PyLumerical" - uses: actions/checkout@v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + with: + persist-credentials: false - name: "Login to GitHub container registry" uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 @@ -160,8 +193,10 @@ jobs: password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - name: "Pull Lumerical Unified Container" + env: + DOCKER_IMAGE_LUMERICAL_UNIFIED: ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} run: | - docker pull ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} + docker pull ${DOCKER_IMAGE_LUMERICAL_UNIFIED} - name: "Prepare ownership for container user (lumerical)" env: @@ -174,20 +209,26 @@ jobs: ls -la - name: "Run Lumerical Unified Container" + env: + DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} + DOCKER_IMAGE_LUMERICAL_UNIFIED: ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} + LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }} run: | docker run \ --detach -it \ --network="host" \ - --name ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} \ - --env ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }} \ + --name ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} \ + --env ANSYSLMD_LICENSE_FILE=1055@${LICENSE_SERVER} \ --mount type=bind,source=${PWD},target=/home/lumerical/pylumerical \ - ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} + ${DOCKER_IMAGE_LUMERICAL_UNIFIED} - name: "Install Project Dependencies and Run Tests" + env: + DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} run: | docker exec \ --workdir /home/lumerical/pylumerical \ - ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} /bin/bash --login -c \ + ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} /bin/bash --login -c \ "python -m pip install -e .[tests] && \ pytest --cov="/home/lumerical/.local/lib/python3.13/site-packages/ansys/api/lumerical/" \ --cov="./tests/unit" --cov-report=xml:.cov/xml --cov-report=html:.cov/html --verbose" @@ -228,7 +269,9 @@ jobs: - name: "Stop lumerical services" if: always() + env: + DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} run: | - docker stop ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} - docker logs ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} - docker rm ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} + docker stop ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} + docker logs ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} + docker rm ${DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index b4bcbe5..5a9533d 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,18 +1,18 @@ -# Contributor Covenant Code of Conduct +# Contributor covenant code of conduct -## Our Pledge +## Pledge -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our -project and our community a harassment-free experience for everyone, -regardless of age, body size, disability, ethnicity, sex -characteristics, gender identity and expression, level of experience, -education, socioeconomic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. +In the interest of fostering an open and welcoming environment, +all contributors and maintainers pledge to making participation +in the Ansys project and community a harassment-free experience +for everyone, regardless of age, body size, disability, ethnicity, +sex characteristics, gender identity and expression, level of +experience, education, socioeconomic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. -## Our Standards +## Standards -Examples of behavior that contributes to creating a positive environment +Examples of behavior that contribute to creating a positive environment include: * Using welcoming and inclusive language @@ -32,7 +32,7 @@ Examples of unacceptable behavior by participants include: * Other conduct which could reasonably be considered inappropriate in a professional setting -## Our Responsibilities +## Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in @@ -48,14 +48,14 @@ offensive, or harmful. This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed +representing a project or community include using an official project email +address, posting using an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], +This code of conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ba1f31..55e1f10 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,2 +1,24 @@ -# Contributing +# Contribute +Overall guidance on contributing to a PyAnsys library appears in the +[Contributing] topic in the *PyAnsys developer's guide*. Ensure that you +are thoroughly familiar with this guide before attempting to contribute to +PyLumerical. + +The following contribution information is specific to PyLumerical. + +## PyLumerical + +We absolutely welcome any code contributions and we hope that this +guide will facilitate an understanding of the PyLumerical code +repository. It is important to note that while the PyLumerical software +package is maintained by ANSYS and any submissions will be reviewed +thoroughly before merging, we still seek to foster a community that can +support user questions and develop new features to make this software +a useful tool for all users. As such, we welcome and encourage any +questions or submissions to this repository. + +Further information about contributing to PyLumerical can be found in [PyLumerical Contributing]. + +[Contributing]: https://dev.docs.pyansys.com/how-to/contributing.html +[PyLumerical Contributing]: https://lumerical.docs.pyansys.com/version/stable/contributing.html diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 69b5347..845a7ad 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,8 +2,13 @@ ## Project Lead or Owner -* [First Last]() +* Luke Queenan (https://github.com/lukequeenan-ansys) +* Dylan McGuire (https://github.com/dylanm-ansys) +* Greg Baethge (https://github.com/gregbaethge) ## Individual Contributors -* [First Last]() +* Marius Ghetie (https://github.com/mghetie-ansys) +* Adan Wang (https://github.com/adan-wang-2) +* Anna Wirth-Singh (https://github.com/annawirthsingh-ansys) +* Taylor Robertson (https://github.com/taylor5005) diff --git a/README.rst b/README.rst index a570aa1..92104dd 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,34 @@ PyLumerical =========== +|pyansys| |python| |pypi| |codecov| |GH-CI| |MIT| |ruff| + +.. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC + :target: https://docs.pyansys.com/ + :alt: PyAnsys + +.. |python| image:: https://img.shields.io/pypi/pyversions/ansys-lumerical-core?logo=pypi + :target: https://pypi.org/project/ansys-lumerical-core/ + :alt: Python + +.. |pypi| image:: https://img.shields.io/pypi/v/ansys-lumerical-core.svg?logo=python&logoColor=white&label=PyPI + :target: https://pypi.org/project/ansys-lumerical-core + :alt: PyPI + +.. |codecov| image:: https://codecov.io/github/ansys/pylumerical/graph/badge.svg?token=34FKDS6ZKJ + :target: https://codecov.io/github/ansys/pylumerical + :alt: Codecov + +.. |GH-CI| image:: https://github.com/ansys/pylumerical/actions/workflows/ci_cd_pr.yml/badge.svg + :target: https://github.com/ansys/pylumerical/actions/workflows/ci_cd_pr.yml + +.. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg + :target: https://opensource.org/licenses/MIT + :alt: MIT + +.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json + :target: https://github.com/astral-sh/ruff + :alt: Ruff + A Python wrapper for Ansys Lumerical products. @@ -22,16 +51,14 @@ Then, install using: python -m pip install ansys-lumerical-core -For more information, see the `installation and getting started section `_ in the documentation. +For more information, see the `installation and getting started section `_ in the documentation. Contributing to PyLumerical --------------------------- -For guidelines on contribution and how to install PyLumerical as a developer, see the `contributing section `_ section in the documentation. +For guidelines on contribution and how to install PyLumerical as a developer, see the `contributing section `_ section in the documentation. Getting started ---------------- -Please see the `installation and getting started section `_ in the documentation for more information. - - +Please see the `installation and getting started section `_ in the documentation for more information. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..6e73fa7 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,40 @@ + + +# Security Policy + +## Reporting a vulnerability + +> [!CAUTION] +> Do not use GitHub issues to report any security vulnerabilities. + +If you detect a vulnerability, contact the [PyAnsys Core team](mailto:pyansys.core@ansys.com), +mentioning the repository and the details of your finding. The team will address it as soon as possible. + +Provide the PyAnsys Core team with this information: + +- Any specific configuration settings needed to reproduce the problem +- Step-by-step guidance to reproduce the problem +- The exact location of the problematic source code, including tag, branch, commit, or a direct URL +- The potential consequences of the vulnerability, along with a description of how an attacker could take advantage of the issue diff --git a/doc/source/changelog/17.maintenance.md b/doc/source/changelog/17.maintenance.md new file mode 100644 index 0000000..08f5e5b --- /dev/null +++ b/doc/source/changelog/17.maintenance.md @@ -0,0 +1 @@ +Updating numerous files and pipeline for initial release