Test & Code

81: TDD with flit


Listen Later

In the last episode, we talked about going from script to supported package.

I worked on a project called subark and did the packaging with flit.

Today's episode is a continuation where we add new features to a supported package and how to develop and test a flit based package.

Covered:

  • viewing stages of a project with git tags
  • flit support for editable installs
  • flit description entry in pyproject.toml to put README on pypi.
  • development dependencies in pyproject.toml
  • editor layout for optimal TDD-ing
  • test case grouping
  • modifications to traditional TDD that helps me develop faster.
  • code and command snippets from episode:

    For git checkout of versions:

    $ git clone https://github.com/okken/submark.git
    $ cd submark
    $ python3 -m venv venv --prompt submark
    $ source ./bin/activate
    (submark) $ git checkout v0.1
    ... etc ...
    (submark) $ git checkout v0.7

    To grab the latest again:

    (submark) $ git checkout master

    pyproject.toml change for README to show up on pypi:

    [tool.flit.metadata]
    ...
    description-file = "README.md"
    ...

    Adding dev dependencies to pyproject.toml:

    [tool.flit.metadata.requires-extra]
    test = ["pytest", "pytest-cov", "tox"]

    Installing in editable mode (in top level repo directory). works in mac, linux, windows:

    (submark) $ flit install --pth-file

    or for mac/linux:

    (submark) $ flit install -s

    Sponsored By:

    • PyCharm Professional: PyCharm is designed by programmers, for programmers, to provide all the tools you need for productive Python development. Promo Code: TESTANDCODE22

    Links:

    • submark · PyPI
    • submark on GitHub
    • The pyproject.toml config file — Flit 1.3 documentation
    • Flit install — Flit 1.3 documentation
    • Test & Code 80: From Python script to Maintainable Package
    ★ Support this podcast on Patreon ★
    ...more
    View all episodesView all episodes
    Download on the App Store

    Test & CodeBy Brian Okken

    • 4.7
    • 4.7
    • 4.7
    • 4.7
    • 4.7

    4.7

    70 ratings


    More shows like Test & Code

    View all
    Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

    Software Engineering Radio - the podcast for professional software developers

    272 Listeners

    The Changelog: Software Development, Open Source by Changelog Media

    The Changelog: Software Development, Open Source

    283 Listeners

    Thoughtworks Technology Podcast by Thoughtworks

    Thoughtworks Technology Podcast

    41 Listeners

    Data Skeptic by Kyle Polich

    Data Skeptic

    483 Listeners

    Talk Python To Me by Michael Kennedy

    Talk Python To Me

    592 Listeners

    Software Engineering Daily by Software Engineering Daily

    Software Engineering Daily

    625 Listeners

    Soft Skills Engineering by Jamison Dance and Dave Smith

    Soft Skills Engineering

    269 Listeners

    Python Bytes by Michael Kennedy and Brian Okken

    Python Bytes

    213 Listeners

    Data Engineering Podcast by Tobias Macey

    Data Engineering Podcast

    142 Listeners

    Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

    Syntax - Tasty Web Development Treats

    981 Listeners

    Practical AI by Practical AI LLC

    Practical AI

    190 Listeners

    The Stack Overflow Podcast by The Stack Overflow Podcast

    The Stack Overflow Podcast

    64 Listeners

    The Real Python Podcast by Real Python

    The Real Python Podcast

    140 Listeners

    Oxide and Friends by Oxide Computer Company

    Oxide and Friends

    47 Listeners

    The Pragmatic Engineer by Gergely Orosz

    The Pragmatic Engineer

    52 Listeners