Skip to content

Commit c407f7b

Browse files
Update internal docs related to DipDup config (#257)
* Update internal docs related to DipDup config * Lint * drop --hashes; * More docs * Lint * Contribution, docstring script
1 parent 53c42fd commit c407f7b

File tree

5 files changed

+212
-51
lines changed

5 files changed

+212
-51
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Changelog
22

3-
Please use [this](https://docs.gitlab.com/ee/development/changelog.html) document as guidelines to keep a changelog.
4-
53
## [unreleased]
64

75
### Added
@@ -18,6 +16,7 @@ Please use [this](https://docs.gitlab.com/ee/development/changelog.html) documen
1816

1917
* config: Removed dummy `advanced.oneshot` flag.
2018
* cli: Removed `docker init` command.
19+
* cli: Removed dummy `schema approve --hashes` flag.
2120

2221
## 5.0.0-rc2 - 2022-03-13
2322

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# DipDup contribution guide
2+
3+
## Codestyle
4+
5+
## Releases
6+
7+
## Documentation
8+
9+
* All changes that affect user experience MUST be documented in CHANGELOG.md file.
10+
* Changelog formatting SHOULD stick to GitLab changelog [guidelines](https://docs.gitlab.com/ee/development/changelog.html).

scripts/extract_reference.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import importlib
2+
3+
config_module = importlib.import_module('dipdup.config')
4+
for name, member in config_module.__dict__.items():
5+
if not name.endswith('Config'):
6+
continue
7+
if isinstance(member, type):
8+
doc = member.__doc__
9+
if not doc:
10+
continue
11+
12+
print()
13+
print(f'=> {name}')
14+
print()
15+
print('| field | description |')
16+
print('| - | - |')
17+
for line in doc.split('\n'):
18+
line = line.strip()
19+
if line.startswith(':param'):
20+
parts = line.split(':')
21+
param, desc = parts[1], parts[2].strip()
22+
print(f'| `{param[6:]}` | {desc} |')

src/dipdup/cli.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import signal
66
import subprocess
77
import sys
8-
import warnings
98
from contextlib import AsyncExitStack
109
from contextlib import suppress
1110
from dataclasses import dataclass
@@ -320,13 +319,9 @@ async def schema(ctx):
320319

321320

322321
@schema.command(name='approve', help='Continue to use existing schema after reindexing was triggered')
323-
@click.option('--hashes', is_flag=True, help='Recalculate all schema and config hashes')
324322
@click.pass_context
325323
@cli_wrapper
326-
async def schema_approve(ctx, hashes: bool):
327-
if hashes:
328-
warnings.warn('`--hashes` option is deprecated and has no effect', DeprecationWarning)
329-
324+
async def schema_approve(ctx):
330325
config: DipDupConfig = ctx.obj.config
331326
url = config.database.connection_string
332327
models = f'{config.package}.models'

0 commit comments

Comments
 (0)