-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kristian Rother
committed
Jan 15, 2024
1 parent
21d6ad4
commit c22a1f1
Showing
4 changed files
with
42 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,8 +121,8 @@ You should see a message similar to: | |
|
||
:: | ||
|
||
kristian@mylaptop:~/projects$ git clone [email protected]:krother/snake.git | ||
Cloning into 'snake'... | ||
kristian@mylaptop:~/projects$ git clone [email protected]:krother/dungeon_explorer.git | ||
Cloning into 'dungeon_explorer'... | ||
remote: Enumerating objects: 5, done. | ||
remote: Counting objects: 100% (5/5), done. | ||
remote: Compressing objects: 100% (4/4), done. | ||
|
@@ -133,7 +133,7 @@ There also should be a new folder: | |
|
||
:: | ||
|
||
kristian@mylaptop:~/projects$ ls -la snake | ||
kristian@mylaptop:~/projects$ ls -la dungeon_explorer | ||
total 24 | ||
drwxrwxr-x 3 kristian kristian 4096 Mai 28 11:33 . | ||
drwxrwxr-x 50 kristian kristian 4096 Mai 28 11:33 .. | ||
|
@@ -151,11 +151,11 @@ like this: | |
|
||
:: | ||
|
||
cd snake/ | ||
cd dungeon_explorer/ | ||
cp ~/Desktop/prototype.py . | ||
git status | ||
git add prototype.py | ||
git commit -m "add a snake prototype" | ||
git commit -m "add a dungeon_explorer prototype" | ||
git push | ||
|
||
To exectute ``git push``, you may need to `Add SSH keys to your GitHub | ||
|
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
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 |
---|---|---|
|
@@ -10,13 +10,13 @@ Assume your project folder contains: | |
|
||
:: | ||
|
||
snake_game/ - module folder you want to import | ||
tests/ - the test code for pytest | ||
.git/ - the commit history (managed by git) | ||
README.md - documentation | ||
LICENSE - legal info | ||
setup.py - used by pip (see below) | ||
.gitignore - choose one on Github | ||
dungeon_explorer/ - module folder you want to import | ||
tests/ - the test code for pytest | ||
.git/ - the commit history (managed by git) | ||
README.md - documentation | ||
LICENSE - legal info | ||
setup.py - used by pip (see below) | ||
.gitignore - choose one on Github | ||
|
||
The Project Folder | ||
------------------ | ||
|
@@ -50,18 +50,16 @@ tells the installer what to install. You can use the following | |
return open(os.path.join(os.path.dirname(__file__), "README.md")).read() | ||
|
||
setup( | ||
name="snake_game", # snake is already taken on PyPi | ||
version="0.0.1", # uses *semantic versioning* | ||
description="a terminal-based snake game", | ||
name="dungeon_explorer", # name used on PyPi | ||
version="0.0.1", # uses *semantic versioning* | ||
description="a simpl dungeon RPG", | ||
long_description=get_readme(), | ||
author="your_name", | ||
author_email="[email protected]", | ||
packages=["snake_game"], # the name of the folder with .py modules | ||
packages=["dungeon_explorer"], # the folder with .py modules | ||
url="https://github.com/...", | ||
license="MIT", | ||
classifiers=[ | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
|
@@ -97,12 +95,12 @@ you should be able to run from any other Python program: | |
|
||
:: | ||
|
||
import snake_game | ||
import dungeon_explorer | ||
|
||
In other words, you don’t actually need to be in your project folder to | ||
use your program. This is super convenient! You can use your package | ||
from anywhere as if it were an official library, like **pandas** or | ||
**sklearn**. You should also see your package in the output of | ||
from anywhere as if it were an official library, like **numpy** or | ||
**pydantic**. You should also see your package in the output of | ||
``pip list`` or ``pip freeze``. | ||
|
||
This method has the advantage that you can still edit your code, and the | ||
|
@@ -168,7 +166,7 @@ install it with | |
|
||
:: | ||
|
||
pip install snake_game | ||
pip install dungeon_explorer | ||
|
||
you need to follow a few more steps. This is not difficult but a bit | ||
tedious. We recommend the official | ||
|