Skip to content

Commit 486e8b2

Browse files
New installer, project templates and related CLI commands (#495)
1 parent 8d96520 commit 486e8b2

File tree

542 files changed

+28283
-1660
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

542 files changed

+28283
-1660
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ on:
1616
jobs:
1717
build:
1818
name: Build
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-22.04
2020
env:
21-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
2221
DOCKER_REGISTRY: ghcr.io
2322
DOCKER_IMAGE_NAME: ${{ github.repository }}
2423

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
jobs:
1515
docs:
1616
name: Docs
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-22.04
1818
steps:
1919
- name: Check out the repo
2020
uses: actions/checkout@v3

.github/workflows/installer.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,34 @@ name: Installer
22
on:
33
push:
44
paths:
5-
- 'cookiecutter/**'
6-
- 'scripts/**'
5+
- 'src/**'
6+
- 'scripts/install.py'
77
- '.github/workflows/installer.yml'
88

99
jobs:
1010
test:
1111
name: Installer
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
steps:
1414
- name: Check out the repo
1515
uses: actions/checkout@v3
1616

17-
- name: Install poetry
18-
run: pipx install poetry
19-
2017
- name: Set up Python
2118
uses: actions/setup-python@v4
2219
with:
2320
python-version: '3.10'
24-
cache: 'poetry'
2521

26-
- name: Install poetry
27-
run: pipx reinstall poetry --python python3.10
22+
- name: Install DipDup
23+
run: python src/dipdup/install.py --quiet --path .
24+
25+
- name: dipdup new
26+
run: dipdup new --quiet
27+
28+
- name: dipdup init
29+
run: cd dipdup-indexer; dipdup init
30+
31+
- name: make install
32+
run: cd dipdup-indexer; make install
2833

29-
- name: Create new project and ensure it's valid
30-
run: python scripts/install.py -q cookiecutter
34+
- name: make lint
35+
run: cd dipdup-indexer; make lint

.github/workflows/release.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ on:
77
jobs:
88
release:
99
name: Release
10-
runs-on: ubuntu-latest
11-
env:
12-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
10+
runs-on: ubuntu-22.04
1311
steps:
1412
- name: Check out the repo
15-
uses: actions/checkout@v2
16-
with:
17-
fetch-depth: 0
13+
uses: actions/checkout@v3
1814

1915
- name: Set up QEMU
2016
uses: docker/setup-qemu-action@v2
@@ -74,7 +70,7 @@ jobs:
7470
- name: Set up Poetry
7571
uses: snok/install-poetry@v1
7672
with:
77-
version: '1.2.0'
73+
version: '1.2.1'
7874

7975
- name: Install project
8076
run: make install
@@ -84,7 +80,7 @@ jobs:
8480
run: make test
8581

8682
- name: Publish stable image (default)
87-
uses: docker/build-push-action@v2
83+
uses: docker/build-push-action@v3
8884
with:
8985
context: .
9086
file: Dockerfile
@@ -95,7 +91,7 @@ jobs:
9591
build-args: PYTEZOS=0
9692

9793
- name: Publish stable image (pytezos)
98-
uses: docker/build-push-action@v2
94+
uses: docker/build-push-action@v3
9995
with:
10096
context: .
10197
file: Dockerfile

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: actions/cache@v2
4141
id: cache-replays
4242
with:
43-
path: /tmp/dipdup/replays
43+
path: ~/.cache/dipdup/replays
4444
key: ${{ matrix.os }}-${{ matrix.arch }}-replays
4545
restore-keys: |
4646
${{ matrix.os }}-${{ matrix.arch }}-replays
@@ -49,5 +49,6 @@ jobs:
4949
run: make install
5050
- name: Run lint
5151
run: make lint
52+
if: contains(matrix.os, 'ubuntu') && contains(matrix.arch, 'amd64')
5253
- name: Run tests
5354
run: make test

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog],
66
and this project adheres to [Semantic Versioning].
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
- install: New install script based on pipx.
13+
- cli: `dipdup new` command to create a new project (ex. cookiecutter).
14+
- cli: `dipdup update` command to update local pipx and poetry installations.
15+
16+
### Fixed
17+
18+
- cli: Commands that only print help pages no longer require a valid config.
19+
- codegen: Fail lately when datamodel-codegen is not available.
20+
- config: Allow `dsn` field to be empty.
21+
- hooks: Raise a `FeatureAvailabilityHook` instead of a warning when trying to execute hooks on SQLite.
22+
23+
### Removed
24+
25+
- install: Cookiecutter template is no longer supported.
26+
27+
### Performance
28+
29+
- cli: Up to 5x decrease in startup time.
30+
831
## [6.1.3] - 2022-09-21
932

1033
### Added
@@ -48,7 +71,7 @@ and this project adheres to [Semantic Versioning].
4871
- ci: Build `arm64` images for M1/M2 silicon.
4972
- ci: Build `-slim` images based on Alpine Linux.
5073
- ci: Introduced official MacOS support.
51-
- ci: Introduced interactive installer (dipdup.net/install.py).
74+
- ci: Introduced interactive installer (dipdup.io/install.py).
5275

5376
## [6.0.1] - 2022-08-19
5477

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN <<eot
88
apt update
99
apt install -y gcc make git `if [[ $PYTEZOS = "1" ]]; then echo build-essential pkg-config libsodium-dev libsecp256k1-dev libgmp-dev; fi`
1010

11-
pip install --no-cache-dir poetry==1.2.0
11+
pip install --no-cache-dir poetry==1.2.1
1212

1313
mkdir -p /opt/dipdup
1414

@@ -37,7 +37,7 @@ SHELL ["/bin/bash", "-c"]
3737

3838
RUN <<eot
3939
useradd -ms /bin/bash dipdup
40-
pip install --no-cache-dir poetry==1.2.0 setuptools
40+
pip install --no-cache-dir poetry==1.2.1 setuptools
4141

4242
apt update
4343
apt install -y --no-install-recommends git `if [[ $PYTEZOS = "1" ]]; then echo libsodium-dev libsecp256k1-dev libgmp-dev; fi`

Makefile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ TAG=latest
1515
help: ## Show this help (default)
1616
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
1717

18-
all: ## Run a whole CI pipeline: lint, run tests, build docs
18+
all: ## Run a whole CI pipeline: formatters, linters and tests
1919
make install lint test docs
2020

2121
install: ## Install project dependencies
@@ -30,6 +30,7 @@ test: ## Run test suite
3030
poetry run pytest --cov-report=term-missing --cov=dipdup --cov-report=xml -n auto --dist loadscope -s -v tests
3131

3232
docs: ## Build docs
33+
scripts/update_cookiecutter.py
3334
cd docs
3435
make -s clean docs markdownlint orphans || true
3536

@@ -70,16 +71,19 @@ image-slim: ## Build slim Docker image
7071
##
7172

7273
release-patch: ## Release patch version
74+
make update all build image
7375
bumpversion patch
7476
git push --tags
7577
git push
7678

7779
release-minor: ## Release minor version
80+
make update all build image
7881
bumpversion minor
7982
git push --tags
8083
git push
8184

8285
release-major: ## Release major version
86+
make update all build image
8387
bumpversion major
8488
git push --tags
8589
git push
@@ -89,14 +93,13 @@ release-major: ## Release major version
8993
clean: ## Remove all files from .gitignore except for `.venv`
9094
git clean -xdf --exclude=".venv"
9195

92-
update: ## Update dependencies, export requirements.txt (wait an eternity)
96+
update: ## Update dependencies, export requirements.txt
9397
make install
9498
poetry update
9599

96100
cp pyproject.toml pyproject.toml.bak
97101
cp poetry.lock poetry.lock.bak
98102

99-
# NOTE: 1.2.0 spells
100103
poetry export --without-hashes -o requirements.txt
101104
poetry export --without-hashes -o requirements.pytezos.txt -E pytezos
102105
poetry export --without-hashes -o requirements.dev.txt --with dev
@@ -108,6 +111,10 @@ update: ## Update dependencies, export requirements.txt (wait an eternit
108111

109112
make install
110113

111-
scripts/update_demos.sh
114+
scripts:
115+
python scripts/update_cookiecutter.py
116+
python scripts/update_demos.py
117+
make lint
112118

113-
##
119+
##
120+
##

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
[![Python](https://img.shields.io/badge/made%20with-python-blue.svg?)](https://www.python.org)
2-
[![GitHub stars](https://img.shields.io/github/stars/dipdup-net/dipdup)](https://github.com/dipdup-net/dipdup)
3-
[![Latest stable release](https://img.shields.io/github/v/release/dipdup-net/dipdup?label=stable)](https://github.com/dipdup-net/dipdup/releases)
4-
[![Latest pre-release)](https://img.shields.io/github/v/release/dipdup-net/dipdup?include_prereleases&label=latest)](https://github.com/dipdup-net/dipdup/releases)
5-
[![PyPI monthly downloads](https://img.shields.io/pypi/dm/dipdup)](https://pypi.org/project/dipdup/)
1+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dipdup?color=2c2c2c)](https://www.python.org)
2+
[![Latest stable release](https://img.shields.io/github/v/release/dipdup-net/dipdup?label=stable&color=2c2c2c)](https://github.com/dipdup-net/dipdup/releases)
3+
[![Latest pre-release)](https://img.shields.io/github/v/release/dipdup-net/dipdup?include_prereleases&label=latest&color=2c2c2c)](https://github.com/dipdup-net/dipdup/releases)
4+
[![License: MIT](https://img.shields.io/github/license/dipdup-net/dipdup?color=2c2c2c)](https://github.com/dipdup-net/dipdup/blob/master/LICENSE)
65
<br>
7-
[![GitHub tests](https://img.shields.io/github/workflow/status/dipdup-net/dipdup/Test)](https://github.com/dipdup-net/dipdup/actions)
8-
[![GitHub issues](https://img.shields.io/github/issues/dipdup-net/dipdup)](https://github.com/dipdup-net/dipdup/issues)
9-
[![GitHub pull requests](https://img.shields.io/github/issues-pr/dipdup-net/dipdup)](https://github.com/dipdup-net/dipdup/pulls)
10-
[![License: MIT](https://img.shields.io/github/license/dipdup-net/dipdup)](https://github.com/dipdup-net/dipdup/blob/master/LICENSE)
6+
[![GitHub stars](https://img.shields.io/github/stars/dipdup-net/dipdup?color=2c2c2c)](https://github.com/dipdup-net/dipdup)
7+
[![PyPI monthly downloads](https://img.shields.io/pypi/dm/dipdup?color=2c2c2c)](https://pypi.org/project/dipdup/)
8+
[![GitHub issues](https://img.shields.io/github/issues/dipdup-net/dipdup?color=2c2c2c)](https://github.com/dipdup-net/dipdup/issues)
9+
[![GitHub pull requests](https://img.shields.io/github/issues-pr/dipdup-net/dipdup?color=2c2c2c)](https://github.com/dipdup-net/dipdup/pulls)
1110

1211
```text
1312
____ _ ____
@@ -22,12 +21,12 @@ DipDup is a Python framework for building indexers of [Tezos](https://tezos.com/
2221

2322
* **Ready to build your first indexer?** Head to [Quickstart](https://docs.dipdup.io/quickstart).
2423

25-
* **Looking for examples?** Check out [Demo Projects](https://github.com/dipdup-net/dipdup/tree/master/src).
24+
* **Looking for examples?** Check out [Demo Projects](https://docs.dipdup.io/examples/demo-projects) and [Built with DipDup](https://docs.dipdup.io/examples/built-with-dipdup) pages.
2625

27-
* **Want to contribute?** See [Contribution Guide](https://github.com/dipdup-net/dipdup/tree/master/CONTRIBUTING.md).
26+
* **Want to participate?** Vote for issues on [GitHub](https://github.com/dipdup-net/dipdup/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) or [become a sponsor](https://github.com/sponsors/dipdup-net).
2827

2928
* **Have a question?** Contact us on [Discord](https://discord.com/invite/RcPGSdcVSx), [Telegram](https://t.me/baking_bad_chat), or [Slack](https://tezos-dev.slack.com/archives/CV5NX7F2L)!
3029

31-
This project is maintained by the [Baking Bad](https://baking-bad.org/) team.
30+
This project is maintained by the [Baking Bad](https://bakingbad.dev/) team.
3231
<br>
3332
Development is supported by [Tezos Foundation](https://tezos.foundation/).

cookiecutter/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)