Test & Code

80: From Python script to Maintainable Package


Listen Later

This episode is a story about packaging, and flit, tox, pytest, and coverage.

And an alternate solution to "using the src".

Python makes it easy to build simple tools for all kinds of tasks.

And it's great to be able to share small projects with others on your team, in your company, or with the world.

When you want to take a script from "just a script" to maintainable package, there are a few steps, but none of it's hard.

Also, the structure of the code layout changes to help with the growth and support.

Instead of just talking about this from memory, I thought it'd be fun to create a new project and walk through the steps, and report back in a kind of time lapse episode. It should be fun.

Here are the steps we walk through:

  • 0.1 Initial script and tests
  • 0.2 build wheel with flit
  • 0.3 build and test with tox
  • 0.4 move source module into a package directory
  • 0.5 move tests into tests directory
  • Sponsored By:

    • Pantheon: Pantheon makes building, managing, and optimizing websites simpler.
    Get started for free at pantheon.io/testandcode.

    Links:

    • submark repo: A Subset of Markdown
    • Flit documentation
    • Coverage.py documentation
    • tox documentation
    ★ 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