Skip to content

Commit

Permalink
Added custom clean command to setup.py to clean the dist/ build/ and …
Browse files Browse the repository at this point in the history
…*.egg-info/ directories before building the new version.
  • Loading branch information
dagraham committed Dec 25, 2024
1 parent 399959f commit 8e20981
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@
import os

from setuptools import find_packages, setup
from setuptools.command.clean import clean as Clean

from modules.__version__ import version


class CleanCommand(Clean):
"""Custom clean command to tidy up the project root."""

def run(self):
Clean.run(self)
for directory in ["dist", "build", "*.egg-info"]:
os.system(f"rm -rf {directory}")


DESCRIPTION = "Record and report times spent in various activities."
here = os.path.abspath(os.path.dirname(__file__))

Expand All @@ -24,6 +35,7 @@
author="Daniel A Graham",
author_email="dnlgrhm@gmail.com",
packages=find_packages(),
cmdclass={"clean": CleanCommand},
install_requires=[
"click",
"click-shell",
Expand Down

0 comments on commit 8e20981

Please sign in to comment.