Skip to content

Commit f1b5267

Browse files
Initial commit of additive protobuf definitions (#1)
* Initial commit of additive protobuf definitions * Update README * Remove optional qualifiers * Update .github/workflows/ci.yml Co-authored-by: Roberto Pastor Muela <[email protected]> * Update ansys/api/additive/v0/additive_domain.proto Co-authored-by: Roberto Pastor Muela <[email protected]> * Update ansys/api/additive/v0/additive_domain.proto Co-authored-by: Roberto Pastor Muela <[email protected]> * Update ansys/api/additive/v0/additive_domain.proto Co-authored-by: Roberto Pastor Muela <[email protected]> * Update ansys/api/additive/v0/additive_materials.proto Co-authored-by: Roberto Pastor Muela <[email protected]> Co-authored-by: Roberto Pastor Muela <[email protected]>
1 parent bf7c8ff commit f1b5267

19 files changed

+603
-230
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: GitHub CI
2+
3+
# run only on main branch. This avoids duplicated actions on PRs
4+
on:
5+
pull_request:
6+
push:
7+
tags:
8+
- "*"
9+
branches:
10+
- main
11+
12+
env:
13+
MAIN_PYTHON_VERSION: "3.10"
14+
PACKAGE_NAME: "ansys.api.additive"
15+
DEFINITION_VERSION: "v0"
16+
17+
jobs:
18+
build:
19+
name: Build package
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Setup Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
27+
28+
# Uncomment once the proto files are stable enough on their side
29+
30+
# - name: Run protolint
31+
# uses: plexsystems/[email protected]
32+
# with:
33+
# configDirectory: .
34+
35+
- name: Install build requirements
36+
run: |
37+
pip install -U pip
38+
pip install build
39+
40+
- name: Build
41+
run: python -m build
42+
43+
- name: Install
44+
run: pip install dist/*.whl
45+
46+
- name: Test import
47+
run: |
48+
mkdir tmp
49+
cd tmp
50+
python -c "import ${{ env.PACKAGE_NAME }}.${{ env.DEFINITION_VERSION }}; print('Sucessfully imported ${{ env.PACKAGE_NAME}}.${{ env.DEFINITION_VERSION }}')"
51+
python -c "from ${{ env.PACKAGE_NAME }} import __version__; print(__version__)"
52+
53+
- name: Upload packages
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: ansys-api-additive-packages
57+
path: dist/
58+
retention-days: 7
59+
60+
Release:
61+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
62+
needs: [build]
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Set up Python
66+
uses: actions/setup-python@v2
67+
with:
68+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
69+
70+
- uses: actions/download-artifact@v3
71+
72+
- name: Display structure of downloaded files
73+
run: ls -R
74+
75+
# uncomment the following section to permit upload to public PyPI
76+
77+
# - name: Upload to Public PyPi
78+
# run: |
79+
# pip install twine
80+
# twine upload --skip-existing ./**/*.whl
81+
# twine upload --skip-existing ./**/*.tar.gz
82+
# env:
83+
# TWINE_USERNAME: __token__
84+
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
85+
86+
- name: Upload to Private PyPi
87+
run: |
88+
pip install twine
89+
twine upload --skip-existing ./**/*.whl
90+
twine upload --skip-existing ./**/*.tar.gz
91+
env:
92+
TWINE_USERNAME: PAT
93+
TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
94+
TWINE_REPOSITORY_URL: https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/upload
95+
96+
- name: Release
97+
uses: softprops/action-gh-release@v1
98+
with:
99+
generate_release_notes: true
100+
files: |
101+
./**/*.whl
102+
./**/*.tar.gz
103+
./**/*.pdf

.github/workflows/pages.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.gitignore

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1-
_site/
2-
.jekyll-cache/
3-
.jekyll-metadata
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# Virtual environment
7+
venv
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# emacs temp files
31+
*~
32+
33+
# VSCode settings
34+
.vscode
35+
36+
# autogenerated Python code
37+
*pb2*.py
38+
*pb2*.pyi

.protolint.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Lint directives. Documentation:
2+
# https://github.com/yoheimuta/protolint/blob/master/_example/config/.protolint.yaml
3+
lint:
4+
# Linter directories to walk.
5+
directories:
6+
exclude:
7+
- codegen
8+
- doc
9+
- tests
10+
11+
rules:
12+
# Use default rules
13+
all_default: true
14+
15+
# - Proto files are not fully documented.
16+
# - Many repeated messages are not properly pluralized
17+
# - Enum fields are not properly prefixed with the enum name
18+
# - Enum fields with 0 value are not suffixed UNSPECIFIED
19+
# - Prepositions should be exluded from message and field names
20+
remove:
21+
- MESSAGES_HAVE_COMMENT
22+
- SERVICES_HAVE_COMMENT
23+
- RPCS_HAVE_COMMENT
24+
- FIELDS_HAVE_COMMENT
25+
- ENUMS_HAVE_COMMENT
26+
- ENUM_FIELDS_HAVE_COMMENT
27+
- REPEATED_FIELD_NAMES_PLURALIZED
28+
- ENUM_FIELD_NAMES_PREFIX
29+
- ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH
30+
- MESSAGE_NAMES_EXCLUDE_PREPOSITIONS
31+
- FIELD_NAMES_EXCLUDE_PREPOSITIONS
32+
33+
# Linter rules option.
34+
rules_option:
35+
max_line_length:
36+
max_chars: 120

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 ANSYS, Inc. All rights reserved.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,52 @@
1-
# ansys-gh-pages-template
1+
### ansys-api-additive gRPC Interface Package
22

3-
This repo is a simple template using
4-
[jekyll-theme-corp](https://github.com/ansys/jekyll-theme-corp) to demonstrate how to generate a GitHub hosted website using the new [Publishing with a custom GitHub Actions workflow](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow). This approach does not require you to create and deploy from a `gh-pages` branch and simplifies building a GitHub Page.
3+
This Python package contains the auto-generated gRPC Python interface files for
4+
Additive.
55

6-
### Usage
6+
#### Installation
77

8-
You can use this template by:
8+
Provided that these wheels have been published to public PyPI, they can be
9+
installed with:
910

10-
1. Creating a [New](https://github.com/organizations/ansys/repositories/new) repository within the [github.com/ansys](https://github.com/ansys) organization.
11-
2. Add more content by modifying the existing markdown files and expanding it by following the following documentation:
11+
```
12+
pip install ansys-api-additive
13+
```
1214

13-
- [Jekyll - Markdown Guide](https://www.markdownguide.org/tools/jekyll/)
14-
- [Jekyll-Markdown-Cheat-Sheet](https://itopaloglu83.github.io/Jekyll-Markdown-Cheat-Sheet/)
15-
- [About GitHub Pages and Jekyll](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll)
15+
#### Build
16+
17+
To build the gRPC packages, run:
18+
19+
```
20+
pip install build
21+
python -m build
22+
```
23+
24+
This will create both the source distribution containing just the protofiles
25+
along with the wheel containing the protofiles and build Python interface
26+
files.
27+
28+
#### Manual Deployment
29+
30+
After building the packages, manually deploy them with:
31+
32+
```
33+
pip install twine
34+
twine upload dist/*
35+
```
36+
37+
Note that this is automatically done through CI/CD.
38+
39+
#### Automatic Deployment
40+
41+
This repository contains GitHub CI/CD that enables the automatic building of
42+
source and wheel packages for these gRPC Python interface files. By default,
43+
these are built on PRs, the main branch, and on tags when pushing. Artifacts
44+
are uploaded for each PR.
45+
46+
To publicly release wheels to PyPI, ensure your branch is up-to-date and then
47+
push tags. For example, for the version ``v0.5.0``.
48+
49+
```bash
50+
git tag v0.5.0
51+
git push --tags
52+
```

_config.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

another-page.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

ansys/api/additive/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

0 commit comments

Comments
 (0)