Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Deprecation Warning For Conda #1500

Merged
merged 2 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions nbdev/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/18_release.ipynb.

# %% auto 0
__all__ = ['GH_HOST', 'Release', 'changelog', 'release_git', 'release_gh', 'pypi_json', 'latest_pypi', 'pypi_details',
'conda_output_path', 'write_conda_meta', 'write_requirements', 'anaconda_upload', 'release_conda',
'chk_conda_rel', 'release_pypi', 'release_both', 'bump_version', 'nbdev_bump_version']
__all__ = ['GH_HOST', 'CONDA_WARNING', 'Release', 'changelog', 'release_git', 'release_gh', 'pypi_json', 'latest_pypi',
'pypi_details', 'conda_output_path', 'write_conda_meta', 'write_requirements', 'anaconda_upload',
'release_conda', 'chk_conda_rel', 'release_pypi', 'release_both', 'bump_version', 'nbdev_bump_version']

# %% ../nbs/api/18_release.ipynb
from fastcore.all import *
Expand Down Expand Up @@ -251,8 +251,11 @@ def write_requirements(path:str=''):
(d/'requirements.txt').mk_write(req)

# %% ../nbs/api/18_release.ipynb
CONDA_WARNING='Conda support for nbdev is deprecated and scheduled for removal in a future version.'

def anaconda_upload(name, loc=None, user=None, token=None, env_token=None):
"Upload `name` to anaconda"
warn(CONDA_WARNING)
user = f'-u {user} ' if user else ''
if env_token: token = os.getenv(env_token)
token = f'-t {token} ' if token else ''
Expand All @@ -271,6 +274,7 @@ def release_conda(
upload_user:str=None # Optional user to upload package to
):
"Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it"
warn(CONDA_WARNING)
name = get_config().lib_name
write_conda_meta(path)
out = f"Done. Next steps:\n```\ncd {path}\n"""
Expand Down
4 changes: 4 additions & 0 deletions nbs/api/18_release.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,11 @@
"outputs": [],
"source": [
"#| export\n",
"CONDA_WARNING='Conda support for nbdev is deprecated and scheduled for removal in a future version.'\n",
"\n",
"def anaconda_upload(name, loc=None, user=None, token=None, env_token=None):\n",
" \"Upload `name` to anaconda\"\n",
" warn(CONDA_WARNING)\n",
" user = f'-u {user} ' if user else ''\n",
" if env_token: token = os.getenv(env_token)\n",
" token = f'-t {token} ' if token else ''\n",
Expand Down Expand Up @@ -668,6 +671,7 @@
" upload_user:str=None # Optional user to upload package to\n",
"):\n",
" \"Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it\"\n",
" warn(CONDA_WARNING)\n",
" name = get_config().lib_name\n",
" write_conda_meta(path)\n",
" out = f\"Done. Next steps:\\n```\\ncd {path}\\n\"\"\"\n",
Expand Down