Skip to content

Commit d89fc49

Browse files
committed
migrations
1 parent fbda74e commit d89fc49

20 files changed

+80
-216
lines changed

nbdev/migrate.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ def nbdev_migrate_config(path:str='.'): # Project root containing settings.ini
206206
min_python=d.get('min_python', '3.9'), license=_license_map.get(d.get('license', ''), d.get('license', 'Apache-2.0')),
207207
author=d.get('author', ''), author_email=d.get('author_email', ''),
208208
keywords=d.get('keywords', 'nbdev').split(), git_url=git_url, doc_url=doc_url, branch=branch)
209-
# Add dependencies
210-
reqs = d.get('requirements', '').split()
209+
# Add dependencies (combine requirements + pip_requirements)
210+
reqs = d.get('requirements', '').split() + d.get('pip_requirements', '').split()
211211
if reqs: txt = txt.replace('dependencies = []', f'dependencies = {reqs}')
212212
dev_reqs = d.get('dev_requirements', '').split()
213213
if dev_reqs: txt = txt.replace('[tool.setuptools', f'[project.optional-dependencies]\ndev = {dev_reqs}\n\n[tool.setuptools')
@@ -217,6 +217,17 @@ def nbdev_migrate_config(path:str='.'): # Project root containing settings.ini
217217
scripts_lines = [s.strip() for s in scripts.split('\n') if s.strip()]
218218
scripts_toml = '\n[project.scripts]\n' + '\n'.join(scripts_lines)
219219
txt = txt.replace('[tool.setuptools', scripts_toml + '\n\n[tool.setuptools')
220+
# Add classifiers from status/audience/language
221+
_status_map = {'1': 'Planning', '2': 'Pre-Alpha', '3': 'Alpha', '4': 'Beta', '5': 'Production/Stable', '6': 'Mature', '7': 'Inactive'}
222+
status = d.get('status', '').strip()
223+
if status and status in _status_map:
224+
txt = txt.replace(' "Programming Language', f' "Development Status :: {status} - {_status_map[status]}",\n "Programming Language')
225+
audience = d.get('audience', '').strip()
226+
if audience:
227+
txt = txt.replace(' "Programming Language', f' "Intended Audience :: {audience}",\n "Programming Language')
228+
language = d.get('language', '').strip()
229+
if language:
230+
txt = txt.replace(' "Programming Language', f' "Natural Language :: {language}",\n "Programming Language')
220231

221232
# Build [tool.nbdev] only with non-default values
222233
def _toml_val(v):

0 commit comments

Comments
 (0)