Skip to main content

Sample Python Project for creating a new Python Module

Project description

Python Project Template

This project follows the Python Standards declared in PEP 621. This uses a pyproject.yaml to configuration the project. In this example, flit is used to simplify the build process, and publish to pypi.

Project Organization

  • .devcontainer - This directory contains required files for creating a Codespace.
  • .github
    • workflows - Contains GitHub Actions used for building, testing and publishing.
      • publish-test.yml - Publish wheels to https://test.pypi.org/
      • publish.yml - Publish wheels to https://pypi.org/
      • pull-request.yml - Build and Test pull requests before commiting to main.
      • template-sync.yml - Update GitHub Repo with enhancments to base template
  • docs - collect documents (default format .md)
  • src - place new source code here
    • python_package - sample package (this can be deleted when creating a new repository)
  • tests - contains Python based test cases to validation src code
  • .pre-commit-config.yaml - Contains various pre-check fixes for Python
  • .templateversionrc - used to track template version usage.
  • MANIFEST.in - Declares additional files to include in Python whl
  • pyproject.toml - Python Project Declaration
  • ws.code-workspace - Recommended configurations for Visual Studio Code

pyproject.toml

The following sections are defined in the configuration toml.

  • build-system
  • project
    • optional-dependencies
    • urls
  • tool
    • bandit
    • coverage
      • run
      • report
    • pyright
    • pytest
    • tox
    • pylint
      • MESSAGES CONTROL
      • REPORTS
      • REFACTORING
      • BASIC
      • FORMAT
      • LOGGING
      • MISCELLANEOUS
      • SIMILARITIES
      • SPELLING
      • STRING
      • TYPECHECK
      • VARIABLES
      • CLASSES
      • DESIGN
      • IMPORTS
      • EXCEPTIONS

build-system

TODO: add info on flit configuration

project

This section defines the project metadata, which may have been previously contained in a setup.py file.

optional-dependencies

This are otpimal dependancey groups that can be installed via 'pip install .[tests]'. One group is included for dependancies required for testing. A second group is included for PySpark based dependancies.

tool

This section defines the configurations for additional tools used to format, lint, type-check, and analysis Python code.

bandit

Performs Security Static Analysis checks on code base.

black

Auto-formats code

coverage

Configures code coverage reports generatated during testing.

pyright

Performs static type checking on Python.

pytest

Configures various test markers used during testing.

pylint

Performs Linting and Static Analysis. Any modifictions made by the auto-formater (black) are always considered correct.

Publish to PyPi from GitHub

In order to publish to PyPi, a repostirory secret must be created, "PYPI_PASSWORD". In order to publish to the Test PyPi, a second secret must be added, "TEST_PYPI_PASSWORD".

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cx-copilot-0.0.3.tar.gz (97.8 kB view details)

Uploaded Source

Built Distribution

cx_copilot-0.0.3-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file cx-copilot-0.0.3.tar.gz.

File metadata

  • Download URL: cx-copilot-0.0.3.tar.gz
  • Upload date:
  • Size: 97.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for cx-copilot-0.0.3.tar.gz
Algorithm Hash digest
SHA256 cab7bb140c64adce866574e5312d2f94baca4efa989cd456a84b54d93d8961a7
MD5 d0e25b6b9e92be15b0922ee3aa8ff944
BLAKE2b-256 c40f30325dea66d7473c86dfa8184f372a4f5e572808efdb4d36dedff394867d

See more details on using hashes here.

File details

Details for the file cx_copilot-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: cx_copilot-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for cx_copilot-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b4f037c4bb4386a54ddad2299eca300af7186c9a24bdf892d737b120e168ad23
MD5 5f85343634095ee78e7bd44f651d8f33
BLAKE2b-256 7c58215a6d9c0e22e5e1702cc2db094e2f3cd2e3cee304a45b15b5ae15b68942

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page