-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from whisk-ml/project-name
Deriving the project name from `src/<project name>`
- Loading branch information
Showing
6 changed files
with
92 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Guides | ||
|
||
The guides below provide a step-by-step walkthrough of common tasks inside whisk projects. | ||
|
||
```eval_rst | ||
.. toctree:: | ||
:maxdepth: 2 | ||
rename_project | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Renaming a project | ||
|
||
Follow the following steps if you wish to change the name of a whisk project. | ||
|
||
## 1. Update setup.py | ||
|
||
In the project's `setup.py` file, update the `setup` function's `name` argument and the cli command: | ||
|
||
```diff | ||
- name='<old project name>', | ||
+ name='<new project name>', | ||
entry_points={ | ||
'console_scripts': [ | ||
- '<old project name>=<old project name>.cli.main:cli', | ||
+ '<new project name>=<new project name>.cli.main:cli', | ||
], | ||
}, | ||
``` | ||
|
||
## 2. Update the src/<project name> directory | ||
|
||
Rename the `src/<project name>` directory: | ||
|
||
mv src/<old project name> src/<new project name> | ||
|
||
## 3. Find and replace the project name in project files | ||
|
||
In your project files, find and replace `<old project name>.` with `<new project name>.` | ||
|
||
## 4. Re-install the package | ||
|
||
Type the following to re-install the package in editable mode: | ||
|
||
pip install -e . | ||
|
||
## 5. Run tests | ||
|
||
Run both `pytest` and `tox` to ensure all tests pass with the new project name. | ||
|
||
## Extra considerations | ||
|
||
### DVC | ||
|
||
If your project is using [DVC](dvc.html), you may need to run [`dvc move`](https://dvc.org/doc/command-reference/move) to update the paths of files tracked with DVC. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters