Skip to main content

No project description provided

Project description

Description

I created a simple stringutils library with three basic functions.

Steps

Create a simple library

Create a simple stringutils library. I included only three functions in it to keep it simple.

Add docstrings

I added function-level and file-level strings (where necessary). For function level strings, I followed the numpy docstring format.

Add requirements

I included requirements i.e. base.txt and check.txt. I added them under the requirements folder.

Write tests

I added some tests for the functions to verify if they are working well. I am using Pytest for that.

pytest --cov stringutils --cov-report=term-missing --tb=line
pytest --cov . --cov-report=xml --tb=line

Note

  • We can manually import our library functions for tests using __init__.py.
  • Or we can leave it empty and use [setup.py](http://setup.py) to install and use the package in our test.

Add pre-commit hooks

Next, I added pre-commit hooks to make sure that my code is in compliance with the best python practices.

pip install pre-commit
pre-commit install

It will work with each commit. To run manually:

pre-commit run --all-files

GitHub Workflows

We have two workflows i.e. test.yml to test our code and lint.yml to apply pre-commit hooks upon push and pull-requests to the main/master branch. I am also using Codecov action to upload test coverage report. Check the reference link for more details.

Packaging

python setup.py sdist bdist_wheel
or
python -m build (pip install build)
twine check dist/*
twine upload dist/*

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

pytholic-stringutils-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

pytholic_stringutils-0.1.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file pytholic-stringutils-0.1.1.tar.gz.

File metadata

  • Download URL: pytholic-stringutils-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for pytholic-stringutils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2a6b94574bb8100ac81be9cb9b2347a09df7119e337ebcb687eae8cd1daa6188
MD5 c9e5f70beb7de296436155c2d3313149
BLAKE2b-256 c1de2bc33864a5d747ccdde4842776c696db84ff2be0766ff96f45b611b6481f

See more details on using hashes here.

File details

Details for the file pytholic_stringutils-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytholic_stringutils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a8860d220f2446d1d24cbb20640d14f7f4c3d8bf549508597ded174248a8f62c
MD5 a4687229ae5260ae132ad34c28a048b5
BLAKE2b-256 90d721210f382302fdc16613ad36f9ccab4b9d6a685baaae247c8fccadb43a0a

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