From 826e41f47540764866c77aeabee69d27453aca3a Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Mon, 20 Mar 2023 14:18:52 +0100 Subject: [PATCH] Maintenance - release workflow (#28) * Update .gitignore * Update README.md * Support for Python 3.11 * Project configuration * Add release workflow (private pypi) * Drop Python 3.7 support * Remove duplication --- .github/workflows/build_and_test_library.yml | 43 +++++++++++- .gitignore | 2 + AUTHORS.md | 10 +++ CODE_OF_CONDUCT.md | 65 +++++++++++++++++++ CONTRIBUTING.md | 7 ++ README.md | 17 +++-- .../pyproject.toml | 10 +-- 7 files changed, 139 insertions(+), 15 deletions(-) create mode 100644 AUTHORS.md create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md diff --git a/.github/workflows/build_and_test_library.yml b/.github/workflows/build_and_test_library.yml index 679690ba..0c4b89a8 100644 --- a/.github/workflows/build_and_test_library.yml +++ b/.github/workflows/build_and_test_library.yml @@ -48,7 +48,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10' ] + python-version: [ '3.8', '3.9', '3.10', '3.11' ] steps: - uses: actions/checkout@v1 @@ -66,3 +66,44 @@ jobs: working-directory: ansys-grantami-serverapi-openapi run: | tox + + release: + name: "Release" + if: contains(github.ref, 'refs/tags') && github.event_name == 'push' + needs: [build, test] + runs-on: ubuntu-latest + steps: + - name: Set up Python 3.10 + uses: actions/setup-python@v1 + with: + python-version: "3.10" + + - uses: actions/checkout@v3 + + - uses: actions/download-artifact@v3 + with: + name: ansys-grantami-serverapi-openapi-wheel + path: ~/dist + +# - name: Upload to PyPI +# run: | +# pip install twine +# twine upload --skip-existing --non-interactive ~/dist/*.whl +# env: +# TWINE_USERNAME: __token__ +# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + + - name: "Upload artifacts to private PyPi" + shell: bash + run: | + pip install twine + twine upload --verbose --skip-existing --non-interactive ~/dist/*.whl + env: + TWINE_USERNAME: "__token__" + TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} + TWINE_REPOSITORY_URL: "https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/upload" + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: ~/dist/*.whl diff --git a/.gitignore b/.gitignore index 0b831fcc..d2f60252 100644 --- a/.gitignore +++ b/.gitignore @@ -208,3 +208,5 @@ fabric.properties # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser + +.idea/ \ No newline at end of file diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 00000000..d9ae2d50 --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,10 @@ +# Authors + +## Project Lead or Owner + +* [Andy Grigg](https://github.com/Andy-Grigg) + +## Contributors + +* [Doug Addy](https://github.com/da1910) +* [Ludovic Steinbach](https://github.com/ludovicsteinbach) \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..1cf484f1 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,65 @@ +# Contributor Covenant Code of Conduct + +## Our 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, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual + attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +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 +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], +version 1.4, available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..16295a10 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,7 @@ +# Contributing + +Refer to the [PyAnsys Developer's Guide] for contributing to this project. + +[PyAnsys Developer's Guide]: https://dev.docs.pyansys.com/index.html + + diff --git a/README.md b/README.md index 3b5d3890..74e83e24 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# PyAnsys OpenAPI Library Template +# PyAnsys Granta MI Server API ## Project Overview -Autogenerated client library for your python project. Direct use of this package is unsupported. -Use [your wrapper package](https://github.com/pyansys) instead. +Autogenerated client library for the Granta MI Server API Services. Direct use of this package is unsupported. +Use [ansys-grantami-recordlists](https://github.com/pyansys/grantami-recordlists) instead. Commits should generally only be made to this repository to update the OpenAPI YAML definition (stored in `yaml/`). Changes to the Python code will be made automatically when the YAML is modified. @@ -10,16 +10,16 @@ Commits should generally only be made to this repository to update the OpenAPI Y ## Contributing This repository is not under active development. It is only for storing the code generated from the API -definition. All development is done in the -[your wrapper package](https://github.com/pyansys) repository. +definition. All development is done in the following repositories: +- [ansys-grantami-recordlists](https://github.com/pyansys/grantami-recordlists) ## Release Procedure -Since the `ansys---openapi` package is auto-generated, the release process differs slightly from +Since the `ansys-grantami-serverapi-openapi` package is auto-generated, the release process differs slightly from the standard [PyAnsys release procedure](https://dev.docs.pyansys.com/guidelines/dev_practices.html#release-procedures). -1. Ensure the ``main`` branch build status is green, which indicates that that the most recent run of the ``Build and Test +1. Ensure the ``main`` branch build status is green, which indicates that the most recent run of the ``Build and Test Client Library`` workflow was successful. 2. Create a new branch from the ``main`` branch with the name ``release/MAJOR.MINOR`` (for example, release/0.2). 3. Make the following changes in ``ansys---openapi/src/setup.cfg``: @@ -29,8 +29,7 @@ the standard While effort is focused on the release, changes should not be made to either the YAML definition or the ``openapi-client-template``. 5. Wait for the PyAnsys developers to functionally test the new release. Testers should locally install this - branch and use it to run the full suite of tests in the ``main`` branch of - [your wrapper package](https://github.com/pyansys). + branch and use it to run the full suite of tests in the ``main`` branch of the pythonic packages. 6. Tag the release: ```commandline git tag v diff --git a/ansys-grantami-serverapi-openapi/pyproject.toml b/ansys-grantami-serverapi-openapi/pyproject.toml index 6a71de93..7e765cc6 100644 --- a/ansys-grantami-serverapi-openapi/pyproject.toml +++ b/ansys-grantami-serverapi-openapi/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi" [project] name = "ansys-grantami-serverapi-openapi" version = "0.1.0.dev17" -description = "Autogenerated client library for the PyAnsys Library." +description = "Autogenerated client library for the Granta MI Server API." authors = [ {name = "ANSYS, Inc." } ] @@ -24,10 +24,10 @@ classifiers = [ "Operating System :: POSIX", "Operating System :: MacOS", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10" + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11" ] requires-python = ">=3.7" @@ -49,15 +49,15 @@ name = "ansys.grantami.serverapi_openapi" [tool.tox] legacy_tox_ini = """ [tox] -envlist = py37,py38,py39,py310 +envlist = py37,py38,py39,py310,py311 isolated_build = True [gh-actions] python = - 3.7: py37 3.8: py38 3.9: py39 3.10: py310 + 3.11: py311 [testenv] install_command = pip install {opts} {packages}