Skip to content

Commit 2d40a92

Browse files
Initial Push
1 parent df6b23c commit 2d40a92

19 files changed

+337
-0
lines changed

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.PHONY: build build-a build-b
2+
.SILENT:
3+
4+
build: build-base build-dependent
5+
cp abi_dependent/dist/*.whl docs/abi_dependent/
6+
cp base_project/dist/*.whl docs/base_project/
7+
8+
build-base:
9+
$(MAKE) -C base_project build
10+
11+
build-dependent:
12+
$(MAKE) -C abi_dependent build

abi_dependent/Makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.PHONY: clean test coverage build install lint
2+
.SILENT:
3+
4+
# ============================================================================ #
5+
# CLEAN COMMANDS
6+
# ============================================================================ #
7+
8+
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
9+
10+
clean-build: ## remove build artifacts
11+
rm -fr build/
12+
rm -fr dist/
13+
rm -fr .eggs/
14+
find . -name '*.egg-info' -exec rm -fr {} +
15+
find . -name '*.egg' -exec rm -f {} +
16+
17+
clean-pyc: ## remove Python file artifacts
18+
find . -name '*.pyc' -exec rm -f {} +
19+
find . -name '*.pyo' -exec rm -f {} +
20+
find . -name '*~' -exec rm -f {} +
21+
find . -name '__pycache__' -exec rm -fr {} +
22+
23+
clean-test: ## remove test and coverage artifacts
24+
rm -fr .tox/
25+
rm -f .coverage*
26+
rm -fr htmlcov/
27+
rm -fr .pytest_cache
28+
29+
# ============================================================================ #
30+
# BUILD COMMANDS
31+
# ============================================================================ #
32+
33+
build: clean ## builds source and wheel package
34+
flit build --format wheel --null-variant
35+
36+
flit build --format wheel \
37+
--variant-label "abi_1.0.0" \
38+
-p "dependency :: base_project :: 1.0.0"
39+
40+
flit build --format wheel \
41+
--variant-label "abi_2.0.0" \
42+
-p "dependency :: base_project :: 2.0.0"
43+
44+
flit build --format wheel \
45+
--variant-label "abi_3.0.0" \
46+
-p "dependency :: base_project :: 3.0.0"
47+
48+
ls -al dist/

abi_dependent/abi_dependent.py

Whitespace-only changes.

abi_dependent/pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[build-system]
2+
requires = ['flit_core >=3,<4']
3+
build-backend = 'flit_core.buildapi'
4+
5+
[project]
6+
name = "abi_dependent"
7+
version = "0.0.1"
8+
description = "A dummy project for testing purposes"
9+
dependencies = [
10+
"base_project==1.0.0; variant_label == 'abi_1.0.0'",
11+
"base_project==2.0.0; variant_label == 'abi_2.0.0'",
12+
"base_project==3.0.0; variant_label == 'null' or variant_label == 'abi_3.0.0'",
13+
]

base_project/Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.PHONY: clean test coverage build install lint
2+
.SILENT:
3+
4+
# ============================================================================ #
5+
# CLEAN COMMANDS
6+
# ============================================================================ #
7+
8+
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
9+
10+
clean-build: ## remove build artifacts
11+
rm -fr build/
12+
rm -fr dist/
13+
rm -fr .eggs/
14+
find . -name '*.egg-info' -exec rm -fr {} +
15+
find . -name '*.egg' -exec rm -f {} +
16+
17+
clean-pyc: ## remove Python file artifacts
18+
find . -name '*.pyc' -exec rm -f {} +
19+
find . -name '*.pyo' -exec rm -f {} +
20+
find . -name '*~' -exec rm -f {} +
21+
find . -name '__pycache__' -exec rm -fr {} +
22+
23+
clean-test: ## remove test and coverage artifacts
24+
rm -fr .tox/
25+
rm -f .coverage*
26+
rm -fr htmlcov/
27+
rm -fr .pytest_cache
28+
29+
# ============================================================================ #
30+
# BUILD COMMANDS
31+
# ============================================================================ #
32+
33+
build: clean ## builds source and wheel package
34+
for ver in 1.0.0 2.0.0 3.0.0; do \
35+
echo "Building version $$ver"; \
36+
sed -i.bak -E "s/^version = .*/version = \"$$ver\"/" pyproject.toml; \
37+
flit build --format wheel > /dev/null 2>&1 ; \
38+
done; \
39+
mv pyproject.toml.bak pyproject.toml
40+
ls -al dist/

base_project/base_project.py

Whitespace-only changes.

base_project/pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[build-system]
2+
requires = ['flit_core >=3,<4']
3+
build-backend = 'flit_core.buildapi'
4+
5+
[project]
6+
name = "base_project"
7+
description = "A dummy project for testing purposes"
8+
version = "2.0.0"
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)