Skip to content

Commit 3445496

Browse files
committed
Merge branch 'master' of github.com:fastai/nbdev
2 parents d0bfb74 + 8f994cd commit 3445496

File tree

6 files changed

+47
-7
lines changed

6 files changed

+47
-7
lines changed

nbdev/migrate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# %% ../nbs/api/migrate.ipynb 5
1818
def _cat_slug(fmdict):
1919
"Get the partial slug from the category front matter."
20-
slug = '/'.join(sorted(fmdict.get('categories', '')))
20+
slug = '/'.join(fmdict.get('categories', ''))
2121
return '/' + slug if slug else ''
2222

2323
# %% ../nbs/api/migrate.ipynb 7

nbdev/release.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ def _get_conda_meta():
198198
name,ver = cfg.lib_name,cfg.version
199199
url = cfg.doc_host or cfg.git_url
200200

201+
doc_url = (cfg.doc_host + cfg.doc_baseurl) if (cfg.doc_host and cfg.doc_baseurl) else url
202+
dev_url = cfg.git_url if cfg.git_url else url
203+
201204
reqs = ['pip', 'python', 'packaging']
202205
if cfg.get('requirements'): reqs += cfg.requirements.split()
203206
if cfg.get('conda_requirements'): reqs += cfg.conda_requirements.split()
@@ -222,7 +225,7 @@ def _get_conda_meta():
222225
'about': {
223226
'license': 'Apache Software',
224227
'license_family': 'APACHE',
225-
'home': url, 'doc_url': url, 'dev_url': url,
228+
'home': dev_url, 'doc_url': doc_url, 'dev_url': dev_url,
226229
'summary': cfg.get('description'),
227230
'description': descr
228231
},

nbs/api/migrate.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"#|export\n",
8181
"def _cat_slug(fmdict):\n",
8282
" \"Get the partial slug from the category front matter.\"\n",
83-
" slug = '/'.join(sorted(fmdict.get('categories', '')))\n",
83+
" slug = '/'.join(fmdict.get('categories', ''))\n",
8484
" return '/' + slug if slug else '' "
8585
]
8686
},
@@ -93,7 +93,7 @@
9393
"source": [
9494
"#|hide\n",
9595
"_fm1 = _get_fm('../../tests/2020-09-01-fastcore.ipynb')\n",
96-
"test_eq(_cat_slug(_fm1), '/fastai/fastcore')\n",
96+
"test_eq(_cat_slug(_fm1), '/fastcore/fastai')\n",
9797
"\n",
9898
"_fm2 = _get_fm('../../tests/2020-02-20-test.ipynb')\n",
9999
"test_eq(_cat_slug(_fm2), '/jupyter')"

nbs/api/release.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,9 @@
544544
" name,ver = cfg.lib_name,cfg.version\n",
545545
" url = cfg.doc_host or cfg.git_url\n",
546546
"\n",
547+
" doc_url = (cfg.doc_host + cfg.doc_baseurl) if (cfg.doc_host and cfg.doc_baseurl) else url\n",
548+
" dev_url = cfg.git_url if cfg.git_url else url\n",
549+
"\n",
547550
" reqs = ['pip', 'python', 'packaging']\n",
548551
" if cfg.get('requirements'): reqs += cfg.requirements.split()\n",
549552
" if cfg.get('conda_requirements'): reqs += cfg.conda_requirements.split()\n",
@@ -568,7 +571,7 @@
568571
" 'about': {\n",
569572
" 'license': 'Apache Software',\n",
570573
" 'license_family': 'APACHE',\n",
571-
" 'home': url, 'doc_url': url, 'dev_url': url,\n",
574+
" 'home': dev_url, 'doc_url': doc_url, 'dev_url': dev_url,\n",
572575
" 'summary': cfg.get('description'),\n",
573576
" 'description': descr\n",
574577
" },\n",

nbs/migrating.ipynb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"\n",
9797
"cat >>.gitignore <<EOF\n",
9898
"_docs/\n",
99-
"sidebar.yml\n",
99+
"_proc/\n",
100100
"EOF\n",
101101
"```\n",
102102
"\n",
@@ -164,6 +164,17 @@
164164
"---\n",
165165
"```\n",
166166
"\n",
167+
"Or you can also add these flags in a markdown cell,\n",
168+
"```md\n",
169+
"# title\n",
170+
"> description\n",
171+
"\n",
172+
"- skip_showdoc: true\n",
173+
"- skip_exec: true\n",
174+
"\n",
175+
"```\n",
176+
"\n",
177+
"\n",
167178
"## Edit Workflow Permissions\n",
168179
"\n",
169180
"Make sure your workflow permissions are set to \"Read and write permissions\", which you can find in Settings &rarr; Actions &rarr; General &rarr; Workflow permissions:\n",

nbs/tutorials/tutorial.ipynb

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,13 +1371,36 @@
13711371
"To upload your project to pypi, just type `nbdev_pypi` in your project root directory. Once it's complete, a link to your project on pypi is displayed."
13721372
]
13731373
},
1374+
{
1375+
"cell_type": "markdown",
1376+
"metadata": {},
1377+
"source": [
1378+
"### Upload to conda\n",
1379+
"\n",
1380+
"Similar to `pip install` support, we have provided an anaconda compliant installer to upload your project to [anaconda](https://anaconda.org). Once uploaded, your package can be installed by typing `conda install -c your_anaconda_username your-project`.\n",
1381+
"\n",
1382+
"You need to register at anaconda (fill out the form to `Sign Up`) which will create a username and password. You will then need to install the following packages\n",
1383+
"\n",
1384+
"```\n",
1385+
"pip install anaconda-client conda-build conda-verify\n",
1386+
"```\n",
1387+
"\n",
1388+
"Before running the anaconda uploader, you need to login to conda using the CLI command (you will be prompted to enter your username and password)\n",
1389+
"\n",
1390+
"```\n",
1391+
"anaconda login\n",
1392+
"```\n",
1393+
"\n",
1394+
"To upload to anaconda, just type `nbdev_conda` in your project root directory."
1395+
]
1396+
},
13741397
{
13751398
"cell_type": "markdown",
13761399
"metadata": {},
13771400
"source": [
13781401
"### Upload to pypi and conda\n",
13791402
"\n",
1380-
"The command `nbdev_release` from the root of your nbdev repo will bump the version of your module and upload your project to both conda and pypi."
1403+
"The command `nbdev_release_both` from the root of your nbdev repo will upload your project to both conda and pypi."
13811404
]
13821405
},
13831406
{

0 commit comments

Comments
 (0)