Skip to content

Commit d4a8acc

Browse files
committed
Use Pyproject.toml
1 parent ce47b50 commit d4a8acc

27 files changed

Lines changed: 184 additions & 285 deletions

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Please?
66

77
--------------------------------------------
88

9-
Copyright (c) 2013-2024 Rebecca Ann Heineman <becky@burgerbecky.com>
9+
Copyright (c) 2013-2025 Rebecca Ann Heineman <becky@burgerbecky.com>
1010

1111
--------------------------------------------
1212

build_rules.py

Lines changed: 63 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
1010
When any of these tools are invoked, this file is loaded and parsed to
1111
determine special rules on how to handle building the code and / or data.
12+
13+
python -m twine upload --verbose dist/*
14+
15+
cd docs
16+
sphinx-build -M html . temp\build
17+
1218
"""
1319

1420
# pylint: disable=unused-argument
@@ -17,7 +23,8 @@
1723

1824
import os
1925
import sys
20-
from burger import import_py_script, run_command, clean_directories
26+
from burger import clean_directories, run_command, __version__, \
27+
delete_directory, clean_files, lock_files, unlock_files
2128

2229
# If set to True, ``buildme -r``` will not parse directories in this folder.
2330
BUILDME_NO_RECURSE = False
@@ -28,7 +35,33 @@
2835
# If set to True, ``cleanme -r``` will not parse directories in this folder.
2936
CLEANME_NO_RECURSE = True
3037

31-
CLEANME_CONTINUE = True
38+
# ``cleanme`` will clean the listed folders before cleaning this folder.
39+
CLEANME_DEPENDENCIES = []
40+
41+
# Directories to clean
42+
CLEAN_DIR_LIST = [
43+
"makeprojects.egg-info",
44+
"makeprojects-" + __version__,
45+
"dist",
46+
"build",
47+
"temp",
48+
".pytest_cache",
49+
".tox",
50+
".vscode"
51+
]
52+
53+
# Recurse these directories clean
54+
CLEAN_DIR_RECURSE_LIST = (
55+
"temp",
56+
"__pycache__",
57+
"_build"
58+
)
59+
60+
# Delete any files with these extensions
61+
CLEAN_EXTENSION_LIST = (
62+
"*.pyc",
63+
"*.pyo"
64+
)
3265

3366
########################################
3467

@@ -51,10 +84,20 @@ def build(working_directory, configuration):
5184
None if not implemented, otherwise an integer error code.
5285
"""
5386

54-
# Call setup.py to create the distribution files.
55-
run_command(
56-
("python", "setup.py", "sdist", "bdist_wheel"),
57-
working_dir=working_directory)
87+
# Unlock the files to handle Perforce locking
88+
lock_list = unlock_files(working_directory) + \
89+
unlock_files(os.path.join(working_directory, "makeprojects"))
90+
91+
try:
92+
# Use "build" from python to build everything
93+
run_command(
94+
("python", "-m", "build"),
95+
working_dir=working_directory)
96+
97+
# If any files were unlocked, relock them
98+
finally:
99+
lock_files(lock_list)
100+
58101
return 0
59102

60103
########################################
@@ -77,13 +120,21 @@ def clean(working_directory):
77120
None if not implemented, otherwise an integer error code.
78121
"""
79122

80-
# Clean up tox, or pylint
81-
clean_directories(working_directory, "temp")
123+
# Delete all folders, including read only files
124+
for item in CLEAN_DIR_LIST:
125+
delete_directory(os.path.join(working_directory, item))
126+
127+
clean_directories(
128+
working_directory,
129+
CLEAN_DIR_RECURSE_LIST,
130+
recursive=True)
131+
132+
# Delete all *.pyc and *.pyo files
133+
clean_files(
134+
working_directory,
135+
name_list=CLEAN_EXTENSION_LIST,
136+
recursive=True)
82137

83-
# The function exists in setup.py.
84-
# It can be manually invoked with "setup.py clean"
85-
setup = import_py_script(os.path.join(working_directory, "setup.py"))
86-
setup.clean(working_directory)
87138
return 0
88139

89140

docs/Doxyfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,8 @@ RECURSIVE = NO
10391039
# run.
10401040

10411041
EXCLUDE = setup.py \
1042-
build_rules.py
1042+
build_rules.py \
1043+
../makeprojects/core.py
10431044

10441045
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
10451046
# directories that are symbolic links (a Unix file system feature) are excluded

docs/build_rules.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ def clean(working_directory):
120120
None if not implemented, otherwise an integer error code.
121121
"""
122122

123-
clean_directories(working_directory, ("temp", "_build", "build"))
123+
clean_directories(
124+
working_directory, ("temp", "_build"),
125+
delete_read_only=True)
124126
clean_files(working_directory, ".DS_Store")
125127
return 0
126128

docs/conf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
import os
1515
import sys
1616
import errno
17-
import sphinx_rtd_theme
17+
18+
from burger import import_py_script
1819

1920
# Determine if running on "ReadTheDocs.org"
2021

@@ -102,7 +103,6 @@
102103

103104
# Add any paths that contain custom themes here, relative to this directory.
104105
# html_theme_path = ["_themes",]
105-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
106106

107107
# Theme options are theme-specific and customize the look and feel of a theme
108108
# further. For a list of options available for each theme, see the
@@ -257,10 +257,9 @@ def generate_doxygen_xml(app):
257257

258258
# Invoke the prebuild python script to create the README.html
259259
# file if needed using pandoc
260-
sys.path.append(CWD)
261-
build_rules = __import__("build_rules")
262-
sys.path.pop()
263-
build_rules.build(CWD, "all")
260+
build_rules = import_py_script(
261+
os.path.join(CWD, "build_rules.py"))
262+
build_rules.build(CWD, None)
264263

265264
# Call Doxygen to build the documentation
266265
try:

makeprojects/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
__license__ = "MIT License"
103103

104104
# Copyright owner
105-
__copyright__ = "Copyright 2013-2024 Rebecca Ann Heineman"
105+
__copyright__ = "Copyright 2013-2025 Rebecca Ann Heineman"
106106

107107
# Items to import on "from makeprojects import *"
108108
__all__ = [

makeprojects/codeblocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
# Copyright 1995-2024 by Rebecca Ann Heineman becky@burgerbecky.com
4+
# Copyright 1995-2025 by Rebecca Ann Heineman becky@burgerbecky.com
55

66
# It is released under an MIT Open Source license. Please see LICENSE
77
# for license details. Yes, you can use it in a

makeprojects/codewarrior.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
Tab character for XML output
3434
"""
3535

36-
# Copyright 2019-2024 by Rebecca Ann Heineman becky@burgerbecky.com
36+
# Copyright 2019-2025 by Rebecca Ann Heineman becky@burgerbecky.com
3737

3838
# It is released under an MIT Open Source license. Please see LICENSE
3939
# for license details. Yes, you can use it in a

makeprojects/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
Full pathname of the configuration file
4444
"""
4545

46-
# Copyright 2013-2024 by Rebecca Ann Heineman becky@burgerbecky.com
46+
# Copyright 2013-2025 by Rebecca Ann Heineman becky@burgerbecky.com
4747
#
4848
# It is released under an MIT Open Source license. Please see LICENSE
4949
# for license details. Yes, you can use it in a

makeprojects/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
# Copyright 2013-2024 by Rebecca Ann Heineman becky@burgerbecky.com
4+
# Copyright 2013-2025 by Rebecca Ann Heineman becky@burgerbecky.com
55
#
66
# It is released under an MIT Open Source license. Please see LICENSE
77
# for license details. Yes, you can use it in a

0 commit comments

Comments
 (0)