Skip to main content

My sample python repo

Project description

amuni_pysample

Looking to up skill and have some fun building a personal AI, I started to get more serious about Python. This repo is part rant, part jotting down the choices I made after reading articles from people who know a lot more.

Using this repo via git

git clone https://github.com/amishamuni/amuni_pysample.git
cd amuni_pysample
python -m venv env : Create a virtual env
.\env\Scripts\activate : Activate the virtual env
python -m main : Invoke and play around modifying what you want
pytest : To run the sample test or any that you add
deactivate : Deactivate virtual environment

Using this repo from TestPyPI

mkdir trial
cd trial
python -m venv env
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps amuni-pysample==x.y.z
TestPyPI doesnt have the pytest and streamlit versions I specify so install them manually using pip
python -m sample.main

A sample repo for python

This template uses a src layout, and will iterate to use the following:

requirements.txt to specify the dependencies required.

pyproject.toml to specify project metadata and build tools in a tool agnostic format.

Black as a code formatter, mypy as a type checker, Ruff as a fast linter, pyroma as a packaging linter.

Build tools with pip as build frontend, setuptools as build backend.

pytest for a test suite.

pre-commit as a pre-commit tool, to automate checks to be run on your code before a commit.

Github actions to automate building, testing and deploying code.

TestPyPI and PyPI to distribute the package as per recommended process, via twine

Further reading

https://github.com/pypa/sampleproject/tree/main
https://packaging.python.org/en/latest/guides/tool-recommendations/
https://packaging.python.org/en/latest/flow/
https://docs.python.org/3/tutorial/index.html

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

amuni_pysample-4.0.1.tar.gz (40.8 kB view hashes)

Uploaded Source

Built Distribution

amuni_pysample-4.0.1-py3-none-any.whl (30.3 kB view hashes)

Uploaded Python 3

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