-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (56 loc) · 2.24 KB
/
Copy pathMakefile
File metadata and controls
67 lines (56 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
######################################################################
## Packaging
######################################################################
#
# Reference links:
# - Setuptools / PyProject: https://setuptools.pypa.io/en/stable/userguide/pyproject_config.html
# - Meson Python tutorial: https://mesonbuild.com/meson-python/tutorials/introduction.html
# - Build library: https://build.pypa.io/en/stable/ or https://github.com/pypa/build
#
## ins-st
## Package using 'setup.py' (sdist + wheel).
## Depends on 'clean' to ensure no leftover build artifacts.
ins-st: clean
@echo ">> Packaging with 'setup.py' using setuptools/wheel..."
@python setup.py sdist bdist_wheel
@# python setup.py sdist
@# python setup.py bdist_wheel
@# python setup.py build_ext --inplace --verbose
## build-st
## Package using 'build' library (supports setup.py or pyproject.toml)
## Depends on 'clean'.
build-st: clean
@echo ">> Packaging with 'build' library (setup.py or pyproject.toml)..."
@echo " - Configuration can use (setuptools, wheel) or (meson, ninja)."
@python -m build
@# python -m build --sdist
@# python -m build --wheel
@# pip install --no-cache-dir build
######################################################################
## Publishing to PyPI (release)
######################################################################
#
# Targets to verify and upload your package to PyPI.
# - Uses 'twine' to check and upload distribution files.
# - Ensure that version tagging and build artifacts are ready before publishing.
#
## check-release
## Verify distribution files and readiness for PyPI upload.
check-release:
@echo ">> Checking that tagging is complete before publishing..."
@echo ">> Verifying distribution files with twine..."
@# Install twine if needed
@pip install --no-cache-dir twine
@twine check dist/* || true
@echo ">> Distribution files verification completed."
@# twine upload dist/*
@# echo "PyPI publish completed."
## release
## Upload the distribution files to PyPI.
## Depends on 'check-release'.
release: check-release
@echo ">> Uploading distribution files to PyPI..."
@# Example with API token:
@# twine upload dist/* --username __token__ --password <your_api_token>
@twine upload dist/*
@echo ">> PyPI publish completed."