Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Switch packaging from setuptools to poetry #6

Merged
merged 5 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: Install style requirements
run: |
pip install -r requirements_style.txt --disable-pip-version-check
pip install .[style] --disable-pip-version-check
akaszynski marked this conversation as resolved.
Show resolved Hide resolved

- name: Codespell
run: |
Expand All @@ -47,20 +47,19 @@ jobs:

- name: Create wheel
run: |
pip install wheel
python setup.py bdist_wheel
pip install build
python -m build --wheel

- name: Validate wheel
run: |
pip install twine
twine check dist/*

- name: Install library
run: pip install dist/*
- name: Install library, with test extra
run: pip install dist/*[test]

- name: Unit testing
run: |
pip install -r requirements_test.txt
cd tests # so we're testing the install, not local
pytest -vx

Expand All @@ -82,12 +81,11 @@ jobs:
with:
python-version: 3.8

- name: Install library
run: pip install .
- name: Install library, with docs extra
run: pip install .[docs]

- name: Build HTML
run: |
pip install -r requirements_docs.txt
make -C doc html SPHINXOPTS="-W"

- name: Build PDF Documentation
Expand Down
8 changes: 5 additions & 3 deletions ansys/product/library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
>>> library.add(1, 2)

.. note::
It's best to import the version here as well so it can be
referenced at the library level.
The version should be defined here so it can be referenced at the
library level. It is also used by the 'flit' packaging tool.

"""

from ansys.product.library._version import __version__
# Nice string for the version
__version__ = "0.1.0.dev0"

from ansys.product.library.module import add
from ansys.product.library.other_module import Complex
22 changes: 0 additions & 22 deletions ansys/product/library/_version.py

This file was deleted.

54 changes: 54 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "ansys-product-library"
authors = [{name = "ANSYS, Inc."}] # this is required

# You can change the name. The email group works.
maintainers = [{name = "PyAnsys developers", email = "[email protected]"}]
readme = "README.rst"
description = "Template PyAnsys library"
license = {file = "LICENSE"}

# The version is automatically parsed from 'ansys/product/library/__init__.py'
dynamic = ["version"]

# Include all install requirements here.
dependencies = []

# Plan on supporting only the currently supported versions of Python
requires-python = ">=3.7"

# Less than critical but helpful
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.optional-dependencies]
docs = [
greschd marked this conversation as resolved.
Show resolved Hide resolved
"sphinx",
"numpydoc>=1.2",
"pyansys_sphinx_theme>=0.2.0",
"sphinx-copybutton",
]

style = [
"codespell==2.1.0",
"flake8==3.9.2",
]

test = [
"pytest",
"pytest-cov",
]

[project.urls]
Source = "https://github.com/pyansys/template/"

[tool.flit.module]
name = "ansys.product.library"
4 changes: 0 additions & 4 deletions requirements_docs.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements_style.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements_test.txt

This file was deleted.

62 changes: 0 additions & 62 deletions setup.py

This file was deleted.