-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
81 lines (62 loc) · 1.73 KB
/
Makefile
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.PHONY: install dev-install test lint format clean docs build release test-release setup-hooks update-deps run sync-readme update-dev
# Define repository names
PYPI_REPOSITORY = pypi
TEST_PYPI_REPOSITORY = testpypi
# Install from TestPyPI
install-testpypi:
poetry install --source $(TEST_PYPI_REPOSITORY)
# Install from PyPI
install-pypi:
poetry install
# Run tests
test:
poetry run pytest tests/
# Run linter
lint:
poetry run flake8 src/masa_ai tests
# Format code
format:
poetry run black src/masa_ai tests
# Clean up build artifacts
clean:
rm -rf build dist .egg *.egg-info
find . -type d -name '__pycache__' -exec rm -rf {} +
# Generate documentation
docs:
cd docs && make html
# Build the package
build:
poetry build
# Synchronize README files
sync-readme:
poetry run python sync_readme.py
@echo "README files synchronized."
# Run the CLI tool
run:
poetry run masa-ai-cli $(ARGS)
# Create a new test release
test-release: clean build sync-readme
PYPI_TOKEN=$(TEST_PYPI_TOKEN) poetry run semantic-release publish --repository-url https://test.pypi.org/legacy/
# Test validation
test-validate-tweet:
pytest tests/test_validate_tweet.py -s --disable-warnings
# Test trending topics
test-trending-queries:
pytest tests/test_trending_queries.py -s --disable-warnings
# Create a new full release
release: clean build sync-readme
PYPI_TOKEN=$(PYPI_TOKEN) poetry run semantic-release publish
# Set up pre-commit hooks
setup-hooks:
poetry run pre-commit install
# Update dependencies
update-deps:
poetry update
# Generate changelog (if using semantic-release)
changelog:
poetry run semantic-release changelog
# Update dev branch after main release
update-dev:
git switch dev
git pull origin main --force
git push --force origin dev