Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
27 changes: 27 additions & 0 deletions .github/workflows/check-style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check Python Style
on: [pull_request]

jobs:
python-style-check:
strategy:
matrix:
path:
- fred-mlambda
name: Python Style Check for ${{ matrix.path }}
runs-on: ubuntu-latest
steps:
- name: Clone Repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Requirements
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-develop.txt
- name: Execute Style Check
run: |
bash check-style.sh ${{ matrix.path }}
30 changes: 30 additions & 0 deletions .github/workflows/check-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Check Unit-Tests and Simple Coverage Report
on: [pull_request]

jobs:
python-unit-testing:
strategy:
matrix:
path:
- fred-mlambda
name: Unit-Test Check for ${{ matrix.path }}
runs-on: ubuntu-latest
steps:
- name: Clone Repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Requirements
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-develop.txt
- name: Install Package
run: python -m pip install -e ./${{ matrix.path }}
- name: Execute Unit-Tests
run: |
bash tests-unit.sh ${{ matrix.path }}
bash tests-coverage.sh ${{ matrix.path }}
29 changes: 29 additions & 0 deletions .github/workflows/check-types.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check Python Types
on: [pull_request]

jobs:
python-unit-testing:
strategy:
matrix:
path:
- fred-mlambda
name: Python Types Check for ${{ matrix.path }}
runs-on: ubuntu-latest
steps:
- name: Clone Repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Requirements
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-develop.txt
- name: Install Package
run: python -m pip install -e ./${{ matrix.path }}
- name: Execute Type Checks
run: |
bash check-types.sh ${{ matrix.path }}
31 changes: 31 additions & 0 deletions .github/workflows/check-wheel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check Creation of Wheel Package
on: [pull_request]

jobs:
python-wheel-check:
strategy:
matrix:
path:
- fred-mlambda
name: Wheel Package Check for ${{ matrix.path }}
runs-on: ubuntu-latest
steps:
- name: Clone Repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Requirements
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel
- name: Create Wheel Package
run: (cd ${{ matrix.path }}; python setup.py bdist_wheel)
- name: Install Wheel Package
run: python -m pip install ${{ matrix.path }}/dist/fred*.whl
- name: Execute Simple Command to Verify Installation
run: |
python -c "from fred.mlambda.version import version; print(version)"
43 changes: 43 additions & 0 deletions .github/workflows/package-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Python Package Publish

on:
pull_request:
paths:
- .github/workflows/package-publish.yaml
- fred-mlambda/**
types:
- closed
branches:
- main

jobs:
python-publish:
environment: PYPI Package Publishing
strategy:
matrix:
path:
- fred-mlambda
if: github.event.pull_request.merged == true
name: Python Package Build and Publish for ${{ matrix.path }}
runs-on: ubuntu-latest
steps:
- name: Clone Repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Twine
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
- name: Build and Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
GH_BRANCH: ${{ github.ref }}
run: |
(cd ${{ matrix.path }}; python setup.py sdist)
twine upload --verbose --skip-existing ${{ matrix.path }}/dist/*
1 change: 1 addition & 0 deletions check-style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pycodestyle ${1} --max-line-length 120
1 change: 1 addition & 0 deletions check-types.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mypy ${1} --ignore-missing-imports --install-types --non-interactive
2 changes: 2 additions & 0 deletions fred-mlambda/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include requirements.txt
include src/main/fred/mlambda/version
1 change: 1 addition & 0 deletions fred-mlambda/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# FRED MLAMBDA
2 changes: 2 additions & 0 deletions fred-mlambda/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Install the baseline fred-oss package
fred-oss==0.66.0
50 changes: 50 additions & 0 deletions fred-mlambda/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import os
import json
from typing import Dict, List
from setuptools import setup, find_namespace_packages


CODEBASE_PATH = os.environ.get(
"CODEBASE_PATH",
default=os.path.join("src", "main"),
)

with open("requirements.txt", "r") as file:
requirements = [line for line in file.read().splitlines() if line and not line.startswith("#")]

version_filepath = os.path.join(CODEBASE_PATH, "fred", "mlambda", "version")
with open(version_filepath, "r") as file:
version = file.read().strip()


with open("README.md") as file:
readme = file.read()


setup(
name="fred.mlambda",
version=version,
description="FRED-MLAMBDA",
long_description=readme,
long_description_content_type='text/markdown',
url="https://fred.fhr.tools",
author="Fahera Research, Education, and Development",
author_email="fred@fahera.mx",
packages=find_namespace_packages(where=CODEBASE_PATH),
package_dir={
"": CODEBASE_PATH
},
package_data={
"": [
version_filepath,
]
},
entry_points={
"console_scripts": [
"fred-mlambda=fred.mlambda.cli.main:CLI.cli_exec",
]
},
install_requires=requirements,
include_package_data=True,
python_requires=">=3.11",
)
Empty file.
1 change: 1 addition & 0 deletions fred-mlambda/src/main/fred/mlambda/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
9 changes: 9 additions & 0 deletions fred-mlambda/src/main/fred/mlambda/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os

from fred.version import Version


version = Version.from_path(
name="fred.mlambda",
dirpath=os.path.dirname(__file__)
)
5 changes: 5 additions & 0 deletions fred-mlambda/src/test/test_fred/test_mlambda/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from fred.mlambda.version import version


def test_version():
assert isinstance(version.value, str)
12 changes: 12 additions & 0 deletions requirements-develop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pycodestyle==2.14.0
pytest==8.4.1
coverage==7.10.6
cookiecutter==2.6.0
mypy==1.17.1
mypy-extensions==1.1.0
typing_extensions==4.15.0
typed-ast==1.5.5
scalene==1.5.54
ipython==9.4.0
jupyter==1.1.1
streamlit==1.49.1
1 change: 1 addition & 0 deletions tests-coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(cd ${1}; coverage report --omit="test_*","*_remote_module_non_scriptable.py")
1 change: 1 addition & 0 deletions tests-unit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(cd ${1}; coverage run -m pytest src/test)
Loading