Skip to content

Commit

Permalink
Merge pull request #8 from ambitus/pyproject-conversion
Browse files Browse the repository at this point in the history
Update pyproject.toml
  • Loading branch information
lcarcaramo authored Aug 16, 2023
2 parents 8dc8e50 + 86bb8f3 commit 31b6f65
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 77 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
ignore = W503,E122,E203
max-line-length = 99
per-file-ignores = __init__.py:F401
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ If you want to improve the current documentation, that includes adding new docum
When contributing to pyRACF, think about the following:
* Make any necessary updates to `setup.py`.
* Make any necessary updates to `pyproject.toml`.
* Make any necessary updates to `README.md`.
* Make any necessary updates to the gitHub pages documentation in the `gh-pages` branch.
* Add any available test cases to `/tests`.
Expand Down
62 changes: 62 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=61"]

[project]
name="pyRACF"
version="1.0a1"
description="Python interface to RACF using IRRSMO00 RACF Callable Service."
authors = [
{name = "Joe Bostian", email = "jbostian@ibm.com"},
{name = "Frank De Gilio", email = "degilio@us.ibm.com"},
{name = "Leonard J. Carcaramo Jr", email = "lcarcaramo@ibm.com"},
{name = "Elijah Swift", email = "elijah.swift@ibm.com"},
]
readme = "README.md"
requires-python = "~=3.11"
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: IBM Internal For Now...",
"Operating System :: z/OS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Security",
"Topic :: System :: Hardware :: Mainframes",
"Topic :: System :: Systems Administration",
]
dependencies = [
"defusedxml>=0.7.1",
]

[tool.setuptools]
packages=[
"pyracf",
"pyracf.access",
"pyracf.common",
"pyracf.connection",
"pyracf.data_set",
"pyracf.group",
"pyracf.resource",
"pyracf.setropts",
"pyracf.user",
]
license-files=["LICENSE"]

[tool.isort]
profile = "black"

[tool.pylint.FORMAT]
max-args = 6
max-returns = 7
max-attributes = 10

[tool.pylint.'MESSAGES CONTROL']
disable = """
too-few-public-methods,
too-many-public-methods,
import-error,
pointless-statement
"""
12 changes: 0 additions & 12 deletions setup.cfg

This file was deleted.

80 changes: 16 additions & 64 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,81 +1,33 @@
"""PyRACF setup/build configuration."""
"""Build python extension for pyRACF."""
import os
from typing import List

from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext


class CustomBuildExt(build_ext):
"""Build cpyracf python extension."""

def build_extensions(self):
os.environ["_CC_CCMODE"] = "1"
os.environ["_CXX_CCMODE"] = "1"
os.environ["_C89_CCMODE"] = "1"
os.environ["_CC_EXTRA_ARGS"] = "1"
os.environ["_CXX_EXTRA_ARGS"] = "1"
os.environ["_C89_EXTRA_ARGS"] = "1"
build_ext.build_extensions(self)


def get_requirements() -> List[str]:
"""Get dependencies that must be installed with pyRACF."""
with open("requirements.txt", "r", encoding="utf-8") as requirements_file:
return [line.strip() for line in requirements_file.readlines()]


def main():
"""Entrypoint for pyRACF package setup."""
os.environ["CC"] = "xlc"
os.environ["CXX"] = "xlc++"
setup(
name="pyRACF",
version="1.0a1",
description="Python interface to RACF using IRRSMO00 RACF Callable Service.",
author="IBM",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: IBM Internal For Now...",
"Operating System :: z/OS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Security",
"Topic :: System :: Hardware :: Mainframes",
"Topic :: System :: Systems Administration",
],
packages=[
"pyracf",
"pyracf.access",
"pyracf.common",
"pyracf.connection",
"pyracf.data_set",
"pyracf.group",
"pyracf.resource",
"pyracf.setropts",
"pyracf.user",
],
package_dir={"": "."},
ext_modules=[
"""Entrypoint for pyRACF python extension build process."""
setup_args = {
"ext_modules": [
Extension(
"cpyracf",
sources=["pyracf/common/irrsmo00.c"],
extra_compile_args=[
"-D_XOPEN_SOURCE_EXTENDED",
"-Wc,lp64,langlvl(EXTC99),STACKPROTECT(ALL),",
"-qcpluscmt",
],
extra_link_args=["-Wl,INFO"],
]
)
],
python_requires="~=3.11",
license_files=("LICENSE"),
install_requires=get_requirements(),
cmdclass={"build_ext": CustomBuildExt},
)
]
}
os.environ["_CC_CCMODE"] = "1"
os.environ["_CXX_CCMODE"] = "1"
os.environ["_C89_CCMODE"] = "1"
os.environ["_CC_EXTRA_ARGS"] = "1"
os.environ["_CXX_EXTRA_ARGS"] = "1"
os.environ["_C89_EXTRA_ARGS"] = "1"
os.environ["CC"] = "xlc"
os.environ["CXX"] = "xlc++"
setup(**setup_args)


if __name__ == "__main__":
Expand Down

0 comments on commit 31b6f65

Please sign in to comment.