diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 1257910..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @ansys/softwareengineeringcoeleadership diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e062491 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,103 @@ +name: GitHub CI + +# run only on main branch. This avoids duplicated actions on PRs +on: + pull_request: + push: + tags: + - "*" + branches: + - main + +env: + MAIN_PYTHON_VERSION: "3.10" + PACKAGE_NAME: "ansys.api.additive" + DEFINITION_VERSION: "v0" + +jobs: + build: + name: Build package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + + # Uncomment once the proto files are stable enough on their side + + # - name: Run protolint + # uses: plexsystems/protolint-action@v0.7.0 + # with: + # configDirectory: . + + - name: Install build requirements + run: | + pip install -U pip + pip install build + + - name: Build + run: python -m build + + - name: Install + run: pip install dist/*.whl + + - name: Test import + run: | + mkdir tmp + cd tmp + python -c "import ${{ env.PACKAGE_NAME }}.${{ env.DEFINITION_VERSION }}; print('Sucessfully imported ${{ env.PACKAGE_NAME}}.${{ env.DEFINITION_VERSION }}')" + python -c "from ${{ env.PACKAGE_NAME }} import __version__; print(__version__)" + + - name: Upload packages + uses: actions/upload-artifact@v3 + with: + name: ansys-api-additive-packages + path: dist/ + retention-days: 7 + + Release: + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + needs: [build] + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + + - uses: actions/download-artifact@v3 + + - name: Display structure of downloaded files + run: ls -R + + # uncomment the following section to permit upload to public PyPI + + # - name: Upload to Public PyPi + # run: | + # pip install twine + # twine upload --skip-existing ./**/*.whl + # twine upload --skip-existing ./**/*.tar.gz + # env: + # TWINE_USERNAME: __token__ + # TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + + - name: Upload to Private PyPi + run: | + pip install twine + twine upload --skip-existing ./**/*.whl + twine upload --skip-existing ./**/*.tar.gz + env: + TWINE_USERNAME: PAT + 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: + generate_release_notes: true + files: | + ./**/*.whl + ./**/*.tar.gz + ./**/*.pdf diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml deleted file mode 100644 index e2b7ca4..0000000 --- a/.github/workflows/pages.yml +++ /dev/null @@ -1,52 +0,0 @@ -# Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Jekyll with GitHub Pages dependencies preinstalled - -on: - # Runs on pushes targeting the default branch - pull_request: - push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow one concurrent deployment -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - # Build job - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Pages - uses: actions/configure-pages@v2 - - name: Build with Jekyll - uses: actions/jekyll-build-pages@v1 - with: - source: ./ - destination: ./_site - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - - # Deployment job - deploy: - if: github.ref == 'refs/heads/main' - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 diff --git a/.gitignore b/.gitignore index f82eafc..2227357 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,38 @@ -_site/ -.jekyll-cache/ -.jekyll-metadata +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# Virtual environment +venv + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# emacs temp files +*~ + +# VSCode settings +.vscode + +# autogenerated Python code +*pb2*.py +*pb2*.pyi diff --git a/.protolint.yaml b/.protolint.yaml new file mode 100644 index 0000000..523c3d0 --- /dev/null +++ b/.protolint.yaml @@ -0,0 +1,36 @@ +# Lint directives. Documentation: +# https://github.com/yoheimuta/protolint/blob/master/_example/config/.protolint.yaml +lint: + # Linter directories to walk. + directories: + exclude: + - codegen + - doc + - tests + + rules: + # Use default rules + all_default: true + + # - Proto files are not fully documented. + # - Many repeated messages are not properly pluralized + # - Enum fields are not properly prefixed with the enum name + # - Enum fields with 0 value are not suffixed UNSPECIFIED + # - Prepositions should be exluded from message and field names + remove: + - MESSAGES_HAVE_COMMENT + - SERVICES_HAVE_COMMENT + - RPCS_HAVE_COMMENT + - FIELDS_HAVE_COMMENT + - ENUMS_HAVE_COMMENT + - ENUM_FIELDS_HAVE_COMMENT + - REPEATED_FIELD_NAMES_PLURALIZED + - ENUM_FIELD_NAMES_PREFIX + - ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH + - MESSAGE_NAMES_EXCLUDE_PREPOSITIONS + - FIELD_NAMES_EXCLUDE_PREPOSITIONS + + # Linter rules option. + rules_option: + max_line_length: + max_chars: 120 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ea581cd --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ANSYS, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index b287681..bb95a11 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,52 @@ -# ansys-gh-pages-template +### ansys-api-additive gRPC Interface Package -This repo is a simple template using -[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. +This Python package contains the auto-generated gRPC Python interface files for +Additive. -### Usage +#### Installation -You can use this template by: +Provided that these wheels have been published to public PyPI, they can be +installed with: -1. Creating a [New](https://github.com/organizations/ansys/repositories/new) repository within the [github.com/ansys](https://github.com/ansys) organization. -2. Add more content by modifying the existing markdown files and expanding it by following the following documentation: +``` +pip install ansys-api-additive +``` -- [Jekyll - Markdown Guide](https://www.markdownguide.org/tools/jekyll/) -- [Jekyll-Markdown-Cheat-Sheet](https://itopaloglu83.github.io/Jekyll-Markdown-Cheat-Sheet/) -- [About GitHub Pages and Jekyll](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll) +#### Build + +To build the gRPC packages, run: + +``` +pip install build +python -m build +``` + +This will create both the source distribution containing just the protofiles +along with the wheel containing the protofiles and build Python interface +files. + +#### Manual Deployment + +After building the packages, manually deploy them with: + +``` +pip install twine +twine upload dist/* +``` + +Note that this is automatically done through CI/CD. + +#### Automatic Deployment + +This repository contains GitHub CI/CD that enables the automatic building of +source and wheel packages for these gRPC Python interface files. By default, +these are built on PRs, the main branch, and on tags when pushing. Artifacts +are uploaded for each PR. + +To publicly release wheels to PyPI, ensure your branch is up-to-date and then +push tags. For example, for the version ``v0.5.0``. + +```bash +git tag v0.5.0 +git push --tags +``` diff --git a/_config.yml b/_config.yml deleted file mode 100644 index ec0ffba..0000000 --- a/_config.yml +++ /dev/null @@ -1,8 +0,0 @@ -remote_theme: ansys/jekyll-theme-corp - -plugins: -- jekyll-remote-theme - -collections: - glossary: - output: false diff --git a/another-page.md b/another-page.md deleted file mode 100644 index 95a628a..0000000 --- a/another-page.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -layout: page -title: Another page ---- - -## Welcome to another page - -_yay_ - -## STAGE 1 - -> Hello, world! - -- 1 -- 2 -- 3 - ---- - -|||| -|-|-|-| -|A|B|C| - -## STAGE 2 - -### Step 2.1 - -#### 2.1.1 - -### Step 2.2 - -#### 2.2.1 - -[back](./) diff --git a/ansys/api/additive/VERSION b/ansys/api/additive/VERSION new file mode 100644 index 0000000..6c6aa7c --- /dev/null +++ b/ansys/api/additive/VERSION @@ -0,0 +1 @@ +0.1.0 \ No newline at end of file diff --git a/ansys/api/additive/__init__.py b/ansys/api/additive/__init__.py new file mode 100644 index 0000000..0478aec --- /dev/null +++ b/ansys/api/additive/__init__.py @@ -0,0 +1,8 @@ +"""Autogenerated Python gRPC interface package for ansys-api-additive.""" + +import pathlib + +__all__ = ["__version__"] + +with open(pathlib.Path(__file__).parent / "VERSION", encoding="utf-8") as f: + __version__ = f.read().strip() diff --git a/ansys/api/additive/py.typed b/ansys/api/additive/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/ansys/api/additive/v0/additive_domain.proto b/ansys/api/additive/v0/additive_domain.proto new file mode 100644 index 0000000..c98e390 --- /dev/null +++ b/ansys/api/additive/v0/additive_domain.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; + +package ansys.api.additive.v0; + +option csharp_namespace = "Ansys.Api.Additive"; + +// All units are assumed to be SI unless otherwise noted + +message MachineSettings { + double laser_power = 1; + double scan_speed = 2; + double heater_temperature = 3; + double layer_thickness = 4; + double beam_diameter = 5; + double starting_layer_angle = 6; + double layer_rotation_angle = 7; + double hatch_spacing = 8; + double slicing_stripe_width = 9; +} + +message MeltPoolTimeStep { + double laser_x = 1; + double laser_y = 2; + double length = 3; + double width = 4; + double reference_width = 5; + double depth = 6; + double reference_depth = 7; +} + +message MeltPool { + repeated MeltPoolTimeStep time_steps = 1; +} + +message AdditiveMaterial { + double hardening_factor = 1; + double strain_scaling_factor = 2; + double support_yield_strength_ratio = 3; + double poisson_ratio = 4; + double elastic_modulus = 5; + double material_yield_strength = 6; + double anisotropic_strain_coefficient_parallel = 7; + double anisotropic_strain_coefficient_perpendicular = 8; + double anisotropic_strain_coefficient_z = 9; + double absorptivity_solid_coefficient_a = 10; + double absorptivity_solid_coefficient_b = 11; + double absorptivity_powder_coefficient_a = 12; + double absorptivity_powder_coefficient_b = 13; + double absorptivity_minimum = 14; + double absorptivity_maximum = 15; + double penetration_depth_solid_coefficient_a = 16; + double penetration_depth_solid_coefficient_b = 17; + double penetration_depth_powder_coefficient_a = 18; + double penetration_depth_powder_coefficient_b = 19; + double penetration_depth_minimum = 20; + double penetration_depth_maximum = 21; + double powder_packing_density = 22; + double vaporization_temperature = 23; + double liquidus_temperature = 24; + double solidus_temperature = 25; + double thermal_expansion_coefficient = 26; + double purging_gas_convection_coefficient = 27; + double solid_density_at_room_temperature = 28; + double solid_specific_heat_at_room_temperature = 29; + double solid_thermal_conductivity_at_room_temperature = 30; + double nucleation_constant_bulk = 31; + double nucleation_constant_interface = 32; + string name = 34; + ThermalCharacteristicDataSet thermal_characteristic_data_set = 35; + CharacteristicWidthDataSet characteristic_width_data_set = 36; +} + +message CharacteristicWidthDataSet { + repeated CharacteristicWidthDataPoint characteristic_width_data_points = 1; +} + +message CharacteristicWidthDataPoint { + double speed = 1; + double power = 2; + double characteristic_width = 3; +} + +message ThermalCharacteristicDataSet { + repeated ThermalCharacteristicDataPoint thermal_characteristic_data_points = 1; +} + +message ThermalCharacteristicDataPoint { + double temperature = 1; + double thermal_conductivity = 2; + double specific_heat = 3; + double density = 4; + double thermal_conductivity_ratio = 5; + double density_ratio = 6; + double specific_heat_ratio = 7; +} + +message Progress { + ProgressState state = 1; + int32 percent_complete = 2; // 0 - 100 + string message = 3; + string context = 4; +} + +enum ProgressState { + PROGRESS_STATE_UNSPECIFIED = 0; // default value used in messages + PROGRESS_STATE_WAITING = 1; + PROGRESS_STATE_EXECUTING = 2; + PROGRESS_STATE_COMPLETED = 3; + PROGRESS_STATE_ERROR = 4; +} + +message PorosityResult { + double void_ratio = 1; + double powder_ratio = 2; + double solid_ratio = 3; +} + +message GrainStatistics { + uint32 grain_number = 1; + float area_fraction = 2; + float diameter_um = 3; // microns + float orientation_angle = 4; +} + +message MicrostructureResult { + repeated GrainStatistics xy_circle_equivalence = 1; + repeated GrainStatistics xz_circle_equivalence = 2; + repeated GrainStatistics yz_circle_equivalence = 3; + bytes xy_vtk = 4; + bytes xz_vtk = 5; + bytes yz_vtk = 6; +} \ No newline at end of file diff --git a/ansys/api/additive/v0/additive_materials.proto b/ansys/api/additive/v0/additive_materials.proto new file mode 100644 index 0000000..d4991bc --- /dev/null +++ b/ansys/api/additive/v0/additive_materials.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +// See https://docs.microsoft.com/en-us/aspnet/core/grpc/versioning?view=aspnetcore-6.0 for what consitutes a breaking change +package ansys.api.additive.v0.materials; + +option csharp_namespace = "Ansys.Api.Additive.Materials"; + +import "ansys/api/additive/v0/additive_domain.proto"; +import "google/protobuf/empty.proto"; + +service MaterialsService { + + rpc GetMaterialsList (google.protobuf.Empty) returns (GetMaterialsListResponse); + + rpc GetMaterial (GetMaterialRequest) returns (AdditiveMaterial); +} + +message GetMaterialRequest { + string name = 1; +} + +message GetMaterialsListResponse { + repeated string names = 1; +} diff --git a/ansys/api/additive/v0/additive_process_window_optimization.proto b/ansys/api/additive/v0/additive_process_window_optimization.proto new file mode 100644 index 0000000..ced89c2 --- /dev/null +++ b/ansys/api/additive/v0/additive_process_window_optimization.proto @@ -0,0 +1,69 @@ +syntax = "proto3"; + +package ansys.api.additive.process; + +option csharp_namespace = "Ansys.Api.Additive.ProcessOptimization"; + +// Additive process window related service definition. +service ProcessWindowOptimizationService { + // Sets laser wattage + rpc RefineLaserPower (LaserPowerRange) returns (ProcessWindowSpecification); + rpc SpecifyLaserPower (LaserPowerValues) returns (ProcessWindowSpecification); + + // Turn on process window optimization + rpc OptimizeProcess(OptimizeProcessWindowSettings) returns (stream OptimizeProcessWindowExecutionHeartbeat); + + // Turn off process window optimization + rpc StopProcessWindowOptimization(StopProcessWindowOptimizationSettings) returns (OptimizeProcessWindowCompletionData); +} + +message ProcessWindowNode { + double laserPower = 1; + double scanSpeed = 2; + double baseplateTemperature = 3; + double layerThickness = 4; +} + +message ProcessWindowSpecification { + LaserPowerRange laserPowerRange = 1; +} + +message LaserPowerRange { + int32 minimumLaserPower = 1; + int32 maximumLaserPower = 2; +} + +message LaserPowerValues { + repeated double laserPower = 1; +} + +message MeltPoolDimensions { + double estimatedMeltPoolReferenceWidth = 1; + double estimatedMeltPoolReferenceDepth = 2; + double estimatedMeltPoolWidth = 3; + double estimatedMeltPoolDepth = 4; +} + +message OptimizeProcessWindowSettings { + int32 maximumSimulationTimeInMinutes = 1; +} + +message OptimizeProcessWindowExecutionHeartbeat { + int32 queuedSimulationCount = 1; + repeated ProcessWindowNodeSimulationResult processWindowNodeSimulationResults = 2; +} + +message ProcessWindowNodeSimulationResult { + ProcessWindowNode processWindowNode = 1; + MeltPoolDimensions meltPoolDimensions = 2; +} + +// Settings for stopping optimization. +message StopProcessWindowOptimizationSettings { + bool forceQuitActiveSimulations = 1; +} + +// Metrics, statistics, and data for completed optimization. +message OptimizeProcessWindowCompletionData { + int32 totalSimulationsCompletedDuringOptimization = 1; +} diff --git a/ansys/api/additive/v0/additive_simulation.proto b/ansys/api/additive/v0/additive_simulation.proto new file mode 100644 index 0000000..3e994c5 --- /dev/null +++ b/ansys/api/additive/v0/additive_simulation.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +// See https://docs.microsoft.com/en-us/aspnet/core/grpc/versioning?view=aspnetcore-6.0 for what consitutes a breaking change +package ansys.api.additive.v0.simulation; + +option csharp_namespace = "Ansys.Api.Additive.Simulation"; + +import "ansys/api/additive/v0/additive_domain.proto"; + +// Units are SI unless otherwise noted + +service SimulationService { + rpc SimulateSingleBead(SimulateSingleBeadRequest) returns (stream SimulationResponse); + rpc SimulatePorosity(SimulatePorosityRequest) returns (stream SimulationResponse); + rpc SimulateMicrostructure(SimulateMicrostructureRequest) returns (stream SimulationResponse); +} + +message SimulationResponse { + string id = 1; + oneof ResponseType { + Progress progress = 10; + MeltPool melt_pool = 11; + PorosityResult porosity_result = 13; + MicrostructureResult microstructure_result = 14; + } +} + +message SimulateSingleBeadRequest { + string id = 1; + double bead_length = 2; + BeadType bead_type = 3; + MachineSettings machine = 10; + AdditiveMaterial material = 11; +} + +enum BeadType { + BEAD_TYPE_UNSPECIFIED = 0; + BEAD_TYPE_BEAD_ON_POWDER_LAYER = 1; + BEAD_TYPE_BEAD_ON_BASE_PLATE = 2; +} + +message SimulatePorosityRequest { + string id = 1; + double size_x = 2; + double size_y = 3; + double size_z = 4; + MachineSettings machine = 10; + AdditiveMaterial material = 11; +} + +message SimulateMicrostructureRequest { + string id = 1; + double cube_min_x = 3; + double cube_min_y = 4; + double cube_min_z = 5; + double cube_size_x = 6; + double cube_size_y = 7; + double cube_size_z = 8; + double sensor_dimension = 9; + // indicates that cooling_rate, thermal_gradient, melt_pool* have been provided by user + bool use_provided_thermal_parameters = 10; + MachineSettings machine = 15; + AdditiveMaterial material = 16; + double cooling_rate = 20; // K/s + double thermal_gradient = 21; // K/m + double melt_pool_width = 22; + double melt_pool_depth = 23; + // use HasRandomSeed method to determine if the user provided a seed + uint32 random_seed = 24; +} diff --git a/index.md b/index.md deleted file mode 100644 index 7643c8f..0000000 --- a/index.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -layout: default -title: Home ---- - -Text can be **bold**, _italic_, or ~~strikethrough~~. - -[Link to another page](./another-page.html). - -There should be whitespace between paragraphs. - -There should be whitespace between paragraphs. We recommend including a README, or a file with information about your project. - -# Header 1 - -This is a normal paragraph following a header. GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. - -## Header 2 - -> This is a blockquote following a header. -> -> When something is important enough, you do it even if the odds are not in your favor. - -### Header 3 - -```js -// Javascript code with syntax highlighting. -var fun = function lang(l) { - dateformat.i18n = require('./lang/' + l) - return true; -} -``` - -```cs -// C# code with syntax highlighting. -public record Item(string Name); -``` - -#### Header 4 - -* This is an unordered list following a header. -* This is an unordered list following a header. -* This is an unordered list following a header. - -##### Header 5 - -1. This is an ordered list following a header. -2. This is an ordered list following a header. -3. This is an ordered list following a header. - -###### Header 6 - -| head1 | head two | three | -|:-------------|:------------------|:------| -| ok | good swedish fish | nice | -| out of stock | good and plenty | nice | -| ok | good `oreos` | hmm | -| ok | good `zoute` drop | yumm | - -### There's a horizontal rule below this. - -* * * - -### Here is an unordered list: - -* Item foo -* Item bar -* Item baz -* Item zip - -### And an ordered list: - -1. Item one -1. Item two -1. Item three -1. Item four - -### And a nested list: - -- level 1 item - - level 2 item - - level 2 item - - level 3 item - - level 3 item -- level 1 item - - level 2 item - - level 2 item - - level 2 item -- level 1 item - - level 2 item - - level 2 item -- level 1 item - -### Small image - -![small](./assets/images/small.svg) - -### Large image - -![large](./assets/images/large.svg) - - -### Definition lists can be used with HTML syntax. - -
-
Name
-
Godzilla
-
Born
-
1952
-
Birthplace
-
Japan
-
Color
-
Green
-
- -``` -Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this. -``` - -``` -The final element. -``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..991f454 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools >= 42.0.0", "wheel", "ansys_tools_protoc_helper"] +build-backend = "setuptools.build_meta:__legacy__" diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..13ec299 --- /dev/null +++ b/setup.py @@ -0,0 +1,51 @@ +"""Installation file for the ansys-api-additive package""" + +import os +from datetime import datetime + +import setuptools + +from ansys.tools.protoc_helper import CMDCLASS_OVERRIDE + +# Get the long description from the README file +HERE = os.path.abspath(os.path.dirname(__file__)) +with open(os.path.join(HERE, "README.md"), encoding="utf-8") as f: + long_description = f.read() + +product = "additive" +library = "" +package_info = ["ansys", "api", product, library, "v0"] +with open( + os.path.join(HERE, "ansys", "api", product, library, "VERSION"), encoding="utf-8" +) as f: + version = f.read().strip() + +package_name = "ansys-api-additive" +dot_package_name = ".".join(filter(None, package_info)) + +description = f"Autogenerated python gRPC interface package for {package_name}, built on {datetime.now().strftime('%H:%M:%S on %d %B %Y')}" + +if __name__ == "__main__": + setuptools.setup( + name=package_name, + version=version, + author="ANSYS, Inc.", + author_email="support@ansys.com", + description=description, + long_description=long_description, + long_description_content_type="text/markdown", + url=f"https://github.com/ansys/{package_name}", + license="MIT", + python_requires=">=3.7", + install_requires=["grpcio~=1.47", "protobuf~=3.20"], + packages=setuptools.find_namespace_packages(".", include=("ansys.*",)), + package_data={ + "": ["*.proto", "*.pyi", "py.typed", "VERSION"], + }, + entry_points={ + "ansys.tools.protoc_helper.proto_provider": [ + f"{dot_package_name}={dot_package_name}" + ], + }, + cmdclass=CMDCLASS_OVERRIDE, + )