You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 03_building_and_packaging/pypi_exercise.md
+7-12Lines changed: 7 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,6 @@ diffusion2d.solve()
60
60
61
61
- 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.
62
62
- 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).
64
63
65
64
## Step 3 - Creating folder structure for packaging
66
65
@@ -70,14 +69,14 @@ diffusion2d.solve()
70
69
-**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.
71
70
- 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.
72
71
- 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.
74
73
-**Hint**: Look at the guide on [configuring setuptools with pyproject.toml](https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html).
75
74
76
-
## Step 4 - Create distribution archives
75
+
## Step 4 - Create build artifacts
77
76
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.
79
78
- 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.
81
80
82
81
## Step 5 - Create an account and a API Token on TestPyPI
83
82
@@ -88,7 +87,7 @@ diffusion2d.solve()
88
87
89
88
## Step 6 - Uploading the package
90
89
91
-
- Upload the distribution archives to TestPyPI.
90
+
- Upload the build artifacts to TestPyPI.
92
91
- Go to TestPyPI and view the package which has been uploaded.
93
92
- Take a screenshot of the TestPyPI webpage which displays your package.
94
93
@@ -99,10 +98,6 @@ diffusion2d.solve()
99
98
100
99
## Step 8 - Submitting the exercise
101
100
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.
104
103
-**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