Skip to content

Commit

Permalink
Merge pull request #17 from thomasthaddeus/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
thomasthaddeus authored May 6, 2024
2 parents 65e5b96 + 7872205 commit 339d18b
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 127 deletions.
143 changes: 72 additions & 71 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Publish Python 🐍 distribution 📦 to PyPI

on:
push:
branches:
- main # Runs on push events to the main branch
pull_request:
branches:
- main # Runs on pull requests targeting the main branch
workflow_dispatch: # Allows manual triggering of the workflow
release:
types: [published]

Expand All @@ -13,95 +20,89 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11' # Specify the exact version used for development
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11" # Specify the exact version used for development

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine wheel # Include twine and wheel
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine wheel # Include twine and wheel
- name: Build package
run: python -m build
- name: Build package
run: python -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
name: Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dataanalysistoolkit # Replace <package-name> with your PyPI project name
url: https://pypi.org/p/dataanalysistoolkit # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
name: Sign the Python 🐍 distribution 📦 with Sigstore and upload them to GitHub Release
needs:
- publish-to-pypi
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
project = 'Data Analysis Toolkit'
copyright = '2024, Thaddeus Thomas'
author = 'Thaddeus Thomas'
release = '1.2.0'
release = '1.2.1'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
110 changes: 55 additions & 55 deletions src/dataanalysistoolkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# SOFTWARE.

# Metadata about the package
__version__ = '1.2.0'
__version__ = '1.2.1'
__author__ = 'Thaddeus Thomas'
__email__ = '[email protected]'

Expand All @@ -39,60 +39,60 @@

# Dependency checks
required_packages = {
'pandas': '1.1.5',
'matplotlib': '3.3.4',
'scipy': '1.6.0',
'sklearn': '0.24.1'
}

missing_packages = []

for lib, version in required_packages.items():
try:
pkg = __import__(lib)
if pkg.__version__ < version:
missing_packages.append(f"{lib}>= {version}")
except ImportError:
missing_packages.append(f"{lib}>= {version}")

if missing_packages:
sys.exit("Missing required packages: " + ', '.join(missing_packages))

# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

logger.info("Initializing DataAnalysisToolkit package")

# Initialization code that runs on package import, if any
def _init_package():
# Put any package-wide initialization logic here
logger.debug("Package initialized successfully")

_init_package()

# Ensure that this module only exposes the intended public interface
__all__ = [
"DataAnalysisToolkit",
"DataImputer",
"DataVisualizer",
"FeatureEngineer",
"ModelEvaluator",
"DataPreprocessor",
"ReportGenerator"
]
from .utils import DataImputer
from .model import FeatureEngineer, ModelEvaluator
from .preprocessor import DataPreprocessor
from .generators import ReportGenerator
from .visualizer import DataVisualizer

# Dependency checks
required_packages = {
'pandas': '1.1.5',
'matplotlib': '3.3.4',
'scipy': '1.6.0',
'sklearn': '0.24.1'
"backports.tarfile": "1.1.1",
"build": "1.2.1",
"certifi": "2024.2.2",
"charset-normalizer": "3.3.2",
"click": "8.1.7",
"colorama": "0.4.6",
"contourpy": "1.2.1",
"cycler": "0.12.1",
"docutils": "0.21.2",
"fonttools": "4.51.0",
"greenlet": "3.0.3",
"idna": "3.7",
"importlib_metadata": "7.1.0",
"jaraco.classes": "3.4.0",
"jaraco.context": "5.3.0",
"jaraco.functools": "4.0.1",
"joblib": "1.4.2",
"keyring": "25.2.0",
"kiwisolver": "1.4.5",
"markdown-it-py": "3.0.0",
"matplotlib": "3.8.4",
"mdurl": "0.1.2",
"more-itertools": "10.2.0",
"nh3": "0.2.17",
"nltk": "3.8.1",
"numpy": "1.26.4",
"packaging": "24.0",
"pandas": "2.2.2",
"pillow": "10.3.0",
"pkginfo": "1.10.0",
"Pygments": "2.18.0",
"pyparsing": "3.1.2",
"pyproject_hooks": "1.1.0",
"python-dateutil": "2.9.0.post0",
"pytz": "2024.1",
"pywin32-ctypes": "0.2.2",
"readme_renderer": "43.0",
"regex": "2024.4.28",
"requests": "2.31.0",
"requests-toolbelt": "1.0.0",
"rfc3986": "2.0.0",
"rich": "13.7.1",
"scikit-learn": "1.4.2",
"scipy": "1.13.0",
"seaborn": "0.13.2",
"six": "1.16.0",
"SQLAlchemy": "2.0.30",
"threadpoolctl": "3.5.0",
"tqdm": "4.66.4",
"twine": "5.0.0",
"typing_extensions": "4.11.0",
"tzdata": "2024.1",
"urllib3": "2.2.1",
"zipp": "3.18.1",
}

missing_packages = []
Expand Down

0 comments on commit 339d18b

Please sign in to comment.