Skip to content

Commit

Permalink
Maintenance - release workflow (#28)
Browse files Browse the repository at this point in the history
* Update .gitignore

* Update README.md

* Support for Python 3.11

* Project configuration

* Add release workflow (private pypi)

* Drop Python 3.7 support

* Remove duplication
  • Loading branch information
ludovicsteinbach authored Mar 20, 2023
1 parent 0e8f248 commit 826e41f
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 15 deletions.
43 changes: 42 additions & 1 deletion .github/workflows/build_and_test_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,5 @@ fabric.properties

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

.idea/
10 changes: 10 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -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)
65 changes: 65 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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


17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# 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.


## 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-<product/service>-<library>-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-<product/service>-<library>-openapi/src/setup.cfg``:
Expand All @@ -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<MAJOR.MINOR.0>
Expand Down
10 changes: 5 additions & 5 deletions ansys-grantami-serverapi-openapi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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." }
]
Expand All @@ -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"

Expand All @@ -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}
Expand Down

0 comments on commit 826e41f

Please sign in to comment.