From 483f8903af98baf0aba954e572ce5cf468807432 Mon Sep 17 00:00:00 2001 From: James Faeldon <111378+altcoder@users.noreply.github.com> Date: Thu, 18 Jan 2024 10:45:41 +0800 Subject: [PATCH] Updates for Ayala-specific requirements --- .github/dependabot.yml | 6 +-- .github/workflows/CI.yml | 21 ---------- .github/workflows/build.yml | 20 +++++++++ .../{semantic-pr-check.yml => check-pr.yml} | 0 .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 7 ++++ ...e-actions.yml => sched-actions-update.yml} | 2 +- CODE_OF_CONDUCT.md | 9 ---- LICENSE | 2 +- README.md | 4 +- SECURITY.md | 41 ------------------- SUPPORT.md | 25 ----------- docs/conf.py | 6 +-- docs/index.rst | 2 +- pyproject.toml | 12 +++--- src/python_package/__init__.py | 4 +- src/python_package/hello_world.py | 2 +- tests/conftest.py | 2 +- tests/test_methods.py | 4 +- 19 files changed, 52 insertions(+), 119 deletions(-) delete mode 100644 .github/workflows/CI.yml create mode 100644 .github/workflows/build.yml rename .github/workflows/{semantic-pr-check.yml => check-pr.yml} (100%) create mode 100644 .github/workflows/release.yml rename .github/workflows/{schedule-update-actions.yml => sched-actions-update.yml} (94%) delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 SECURITY.md delete mode 100644 SUPPORT.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8cd4fb90..4e44e190 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,10 +4,10 @@ updates: directory: "/" schedule: interval: daily - time: "13:00" + time: "16:16" open-pull-requests-limit: 10 reviewers: - - dciborow + - altcoder allow: - dependency-type: direct - dependency-type: indirect @@ -17,6 +17,6 @@ updates: directory: "/" schedule: interval: daily - time: "13:00" + time: "16:32" commit-message: prefix: "fix: " diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index eb8ae3ed..00000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Python CI -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - release: - types: [created] - workflow_dispatch: - -jobs: - validation: - uses: microsoft/action-python/.github/workflows/validation.yml@0.6.4 - with: - workdir: '.' - - publish: - uses: microsoft/action-python/.github/workflows/publish.yml@0.6.4 - secrets: - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..bcba5e98 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python Build Workflow + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + release: + types: [created] + workflow_dispatch: + +jobs: + validation: + uses: ac-analytics/action-python/.github/workflows/validation.yml@v0.1.1 + with: + workdir: '.' + testdir: 'tests' \ No newline at end of file diff --git a/.github/workflows/semantic-pr-check.yml b/.github/workflows/check-pr.yml similarity index 100% rename from .github/workflows/semantic-pr-check.yml rename to .github/workflows/check-pr.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9d715609..2971c629 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,7 @@ on: jobs: publish: - uses: microsoft/action-python/.github/workflows/publish.yml@0.6.4 + uses: ac-analytics/action-python/.github/workflows/publish.yml@v0.1.1 secrets: PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..dca35a31 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,7 @@ +name: Python Release Workflow +on: + workflow_call: + +jobs: + release: + uses: ac-analytics/action-python/.github/workflows/release.yml@v0.1.1 diff --git a/.github/workflows/schedule-update-actions.yml b/.github/workflows/sched-actions-update.yml similarity index 94% rename from .github/workflows/schedule-update-actions.yml rename to .github/workflows/sched-actions-update.yml index f4c30b60..fbca7c28 100644 --- a/.github/workflows/schedule-update-actions.yml +++ b/.github/workflows/sched-actions-update.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 with: # [Required] Access token with `workflow` scope. token: ${{ secrets.PAT }} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index f9ba8cf6..00000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Microsoft Open Source Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). - -Resources: - -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/LICENSE b/LICENSE index 9e841e7a..5df52d48 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License - Copyright (c) Microsoft Corporation. + Copyright (c) Ayala Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index cf349a65..9b427fd3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Python Project Template -This project is a template for creating Python projects that follows the Python Standards declared in PEP 621. It uses a pyproject.yaml file to configure the project and Flit to simplify the build process and publish to PyPI. Flit simplifies the build and packaging process for Python projects by eliminating the need for separate setup.py and setup.cfg files. With Flit, you can manage all relevant configurations within the pyproject.toml file, streamlining development and promoting maintainability by centralizing project metadata, dependencies, and build specifications in one place. +This project is a template for creating Python projects that follows the Python Standards declared in PEP 621. It uses a pyproject.toml file to configure the project. + +Flit is used to simplify the build process and publish to PyPI, however for private packages or more complicated setups the use of a separate setup.py and setup.cfg files is okay. However, with Flit, you can manage all relevant configurations within the pyproject.toml file, streamlining development and promoting maintainability by centralizing project metadata, dependencies, and build specifications in one place. ## Project Organization diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index a050f362..00000000 --- a/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). - - diff --git a/SUPPORT.md b/SUPPORT.md deleted file mode 100644 index bcebadb8..00000000 --- a/SUPPORT.md +++ /dev/null @@ -1,25 +0,0 @@ -# TODO: The maintainer of this repo has not yet edited this file - -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? - -- **No CSS support:** Fill out this template with information about how to file issues and get help. -- **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). -- **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide. - -*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* - -# Support - -## How to file issues and get help - -This project uses GitHub Issues to track bugs and feature requests. Please search the existing -issues before filing new issues to avoid duplicates. For new issues, file your bug or -feature request as a new Issue. - -For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE -FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER -CHANNEL. WHERE WILL YOU HELP PEOPLE?**. - -## Microsoft Support Policy - -Support for this **PROJECT or PRODUCT** is limited to the resources listed above. diff --git a/docs/conf.py b/docs/conf.py index 4867d959..6523c5fd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,9 +18,9 @@ # -- Project information ----------------------------------------------------- -project = "ai-python docs" -copyright = "2022, Daniel Ciborowski" -author = "Daniel Ciborowski" +project = "python docs" +project_copyright = "2024, Ayala Corporation" +author = "AC Analytics" # The full version, including alpha/beta/rc tags release = "0.1.0" diff --git a/docs/index.rst b/docs/index.rst index b10c570d..bdb34ab6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -.. ai-python docs documentation master file, created by +.. ada docs documentation master file, created by sphinx-quickstart on Thu May 5 14:06:45 2022. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. diff --git a/pyproject.toml b/pyproject.toml index a8a76c7f..b1851bc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,9 @@ requires = ["flit"] build-backend = "flit.buildapi" [project] -name = "py-project-toml" +name = "python-package-template" authors = [ - {name = "Daniel Ciborowski", email = "dciborow@microsoft.com"}, + {name = "AC Analytics", email = "analytics@ayala.com"}, ] description = "Sample Python Project for creating a new Python Module" readme = "README.md" @@ -47,9 +47,9 @@ test = [ ] [project.urls] -Documentation = "https://github.com/microsoft/python-package-template/tree/main#readme" -Source = "https://github.com/microsoft/python-package-template" -Tracker = "https://github.com/microsoft/python-package-template/issues" +Documentation = "https://github.com/ac-analytics/python-package-template/tree/main#readme" +Source = "https://github.com/ac-analytics/python-package-template" +Tracker = "https://github.com/ac-analytics/python-package-template/issues" [tool.flit.module] name = "python_package" @@ -168,7 +168,7 @@ extension-pkg-whitelist= [ "scipy" ] ignore="CVS" -ignore-patterns="test.*?py,conftest.py" +ignore-patterns="test.*?py,conf.py,conftest.py" init-hook='import sys; sys.setrecursionlimit(8 * sys.getrecursionlimit())' jobs=0 limit-inference-results=100 diff --git a/src/python_package/__init__.py b/src/python_package/__init__.py index 91150271..496e7d00 100644 --- a/src/python_package/__init__.py +++ b/src/python_package/__init__.py @@ -1,8 +1,8 @@ # ------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Ayala Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in project root for information. # ------------------------------------------------------------- """Python Package Template""" from __future__ import annotations -__version__ = "0.0.2" +__version__ = "0.1.0" diff --git a/src/python_package/hello_world.py b/src/python_package/hello_world.py index db43d690..25b767a9 100644 --- a/src/python_package/hello_world.py +++ b/src/python_package/hello_world.py @@ -1,5 +1,5 @@ # --------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Ayala Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in project root for information. # --------------------------------------------------------------------------------- """This is a Sample Python file.""" diff --git a/tests/conftest.py b/tests/conftest.py index ce475219..33b080c5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,5 @@ # --------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Ayala Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in project root for information. # --------------------------------------------------------------------------------- """ diff --git a/tests/test_methods.py b/tests/test_methods.py index 40b57916..8854f818 100644 --- a/tests/test_methods.py +++ b/tests/test_methods.py @@ -1,5 +1,5 @@ # --------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Ayala Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in project root for information. # --------------------------------------------------------------------------------- """This is a sample python file for testing functions from the source code.""" @@ -26,7 +26,7 @@ def test_hello(unit_test_mocks: None): def test_int_hello(): """ - This test is marked implicitly as an integration test because the name contains "_init_" + This test is marked implicitly as an integration test because the name contains "_int_" https://docs.pytest.org/en/6.2.x/example/markers.html#automatically-adding-markers-based-on-test-names """ hello_test()