Skip to content

Commit 648be43

Browse files
committed
Cut parts of exercise which are explained in the lecture notes
1 parent c5f4e37 commit 648be43

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

03_building_and_packaging/pypi_exercise.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ diffusion2d.solve()
6060

6161
- Once you have refactored the code, try calling the `solve()` function again through a Python script or directly in a Python shell. Compare the plots with the plots in the figure you saved earlier. Both outputs should be identical.
6262
- The function `solve()` should take in physical parameters as input arguments. In this case, change the parameters `dx`, `dy` and `D` such that they are passed to the `solve()` function by the user. Provide default values for all three of these parameters.
63-
- In some cases an additional `__init__.py` file may be necessary on each level of the directory structure to ensure that the local import `from .output ...` works. First try to run the refactored code without adding any additional file, and if it is does not work, add the `__init__.py` file. The `__init__.py` should be empty in this case. An explanation of why this file is necessary is found in the [Python packaging documentation](https://packaging.python.org/en/latest/tutorials/packaging-projects/#a-simple-project).
6463

6564
## Step 3 - Creating folder structure for packaging
6665

@@ -70,14 +69,14 @@ diffusion2d.solve()
7069
- **Note**: General recommendation is to have the name of the folder having the source files to be same as the name of the package as seen when imported at the time of use.
7170
- The `README.md` file consists of a longer description about the code and what it does. Take the information about the code from Step 1 of this exercise and add it to the README. In addition to this fill out the empty sections of the README with relevant information.
7271
- In the `pyproject.toml`, name your package `<your-GitLab-username>_diffusion2d` (the underscore `_` between your GitLab username and diffusion2d is important, because any other symbol will not work). We will use semantic versioning, so the version you are developing will be `0.0.1`. The package url is the url of the GitHub repository of this exercise code.
73-
- As the package should be easy to install and provide maximum possible information, try to include as many configuration options as possible.
72+
- Try to add as many configuration options as you can.
7473
- **Hint**: Look at the guide on [configuring setuptools with pyproject.toml](https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html).
7574

76-
## Step 4 - Create distribution archives
75+
## Step 4 - Create build artifacts
7776

78-
- With reference to the lecture notes, create distribution archives for this project. Use the `build` tool to create the distribution archives.
77+
- Create build artifacts for this project. Use the `build` tool to create the build artifacts.
7978
- After creating the distribution packages, check the `dist/` folder to ensure that the archive files have been created.
80-
- **Important**: If for some reason the package does not work and you wish to upload a changed state of the package, then you have to remove all contents of `dist/` before creating new distribution archives.
79+
- **Important**: If for some reason the package does not work and you wish to upload a changed state of the package, you have to remove all contents of `dist/` before creating new build artifacts.
8180

8281
## Step 5 - Create an account and a API Token on TestPyPI
8382

@@ -88,7 +87,7 @@ diffusion2d.solve()
8887

8988
## Step 6 - Uploading the package
9089

91-
- Upload the distribution archives to TestPyPI.
90+
- Upload the build artifacts to TestPyPI.
9291
- Go to TestPyPI and view the package which has been uploaded.
9392
- Take a screenshot of the TestPyPI webpage which displays your package.
9493

@@ -99,10 +98,6 @@ diffusion2d.solve()
9998

10099
## Step 8 - Submitting the exercise
101100

102-
- Open a pull request with the name `Packaged code for PyPI by <your-GitLab-username>` from your fork to the `main` branch of the exercise repository.
103-
- Only push the `pyproject.toml`, `README.md`, and `__init__.py` in addition to the refactored code.
101+
- Open a pull request with the name `Packaged code by <your-GitLab-username>` from your fork to the `main` branch of the exercise repository.
102+
- Only push the refactored code, `pyproject.toml`, `README.md`, and `__init__.py`. Do not push the build artifacts.
104103
- **Important**: Add the TestPyPI screenshot in the description of the pull request opened for submission.
105-
106-
## Bonus: Using Versioneer to handle versioning of code
107-
108-
- Use [Versioneer](https://pypi.org/project/versioneer/) to handle the versioning in your package.

0 commit comments

Comments
 (0)