Commit 72b1c439 authored by Bishnoi, Bhaskar's avatar Bishnoi, Bhaskar
Browse files

build and distribution using pyproject.toml

parent d866d856
Loading
Loading
Loading
Loading

src/pyproject.toml

0 → 100644
+41 −0
Original line number Diff line number Diff line
[build-system]
requires = [
    "setuptools >= 67.0",
    "wheel >= 0.40"
]
build-backend = "setuptools.build_meta"

[project]
name = "common_package"
authors = [
    {name = "Jonathan Huihui", email = "huihuijk@ornl.gov"},
    {name = "Josh Grant", email = "grantjn@ornl.gov"}
]
# update version information here
version = "0.2.0"
description = "Package to perform everyday tasks - logging, accessing database, etc."
readme = "README.md"
requires-python = ">=3.7"
keywords = ["mixins", "logging", "database", "mysqlmixin", "postgresmixin", "pandasmixin"]
license = {file = "LICENSE"}
classifiers = [
    "Intended Audience :: Developers",
    "Programming Language :: Python",
    "Topic :: Software Development :: Build Tools"
]
dependencies = [
    "rich==10.11.0",
    "pandas==2.1.4",
    "psycopg2-binary==2.9.9",
    "pymssql==2.2.11",
    "SQLAlchemy~=2.0.23"
]

[project.urls]
Source = "https://code.ornl.gov/nset-utilities/common-package"

[tool.setuptools.packages.find]
where = []
include = ['common', 'common.mixins']

src/setup.py

deleted100755 → 0
+0 −49
Original line number Diff line number Diff line
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""The setup file for the common package."""
import os
from setuptools import setup

# update version information here
_version = '0.2.0' # '0.1.14'

# packages
_packages = ['common', 'common.mixins']

# retrieve metadata and packages based on files
_here = os.path.abspath(os.path.dirname(__file__))
_requirements_file = _here + '/requirements.txt'
_requirements = []
if os.path.isfile(_requirements_file):
    with open(_requirements_file, 'r', encoding='utf-8') as f:
        _requirements = f.read().splitlines()
_license = 'MIT'
_license_file = _here + 'LICENSE'
if os.path.isfile(_license_file):
    with open(_license_file, 'r', encoding='utf-8') as f:
        _license = f.read()
_description_file = _here + 'README.md'
_long_description = ''
if os.path.isfile(_description_file):
    with open(_description_file, 'r', encoding='utf-8') as f:
        _long_description = f.read()
_scripts_dir = 'scripts/'
_scripts = os.listdir(_here + '/scripts/')
if '.connections' in _scripts:
    _scripts.remove('.connections')
_scripts = ['scripts/' + script for script in _scripts]

# setup
setup(
    name='common',
    version=_version,
    packages=_packages,
    author='Jonathan Huihui',
    author_email='huihuijk@ornl.gov',
    url='https://code.ornl.gov/nset-utilities/common-package',
    license=_license,
    description="Common utilities to use for logging and accessing databases.",
    scripts=_scripts,
    install_requires=_requirements,
    long_description=_long_description,
)
+3 −1
Original line number Diff line number Diff line
@@ -7,7 +7,9 @@ BANNER="$BANNER\n| (_| (_) | | | | | | | | | | | (_) | | | |"
BANNER="$BANNER\n \\___\\___/|_| |_| |_|_| |_| |_|\\___/|_| |_|"
BANNER="$BANNER\n               package helpers"
echo -e "$BANNER"
python3 setup.py sdist bdist_wheel
#python3 setup.py sdist bdist_wheel
python3 -m pip install --upgrade build
python3 -m build
python3 -m twine upload --repository gitlab dist/* --verbose \
  --config-file pypirc.cfg
rm -rf dist/ common.egg-info/ build/