5
5
Can be used as GitHub template repository,
6
6
see [ GitHub documentation] ( https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template ) .
7
7
8
- You will need to find and replace occurences of
8
+ You will need to find and replace occurences of
9
9
10
- - ` mockup ` -> ` your_package_name `
11
- - ` rasmussenlab-mockup ` -> ` your_package_name `
12
- - ` RasmussenLab ` -> ` GitHub_user_name ` (or organization)
13
10
- ` python_package ` -> ` your_package_name `
11
+ - ` RasmussenLab ` -> ` GitHub_user_name ` (or ` organization ` )
14
12
15
- with the name of your package and GitHub user name (or organization). This still might
16
- need further testing:
17
-
18
- ``` bash
19
- # currently these are (v24.03)
20
-
21
- pyproject.toml:
22
- 5 description = " A small example package"
23
- 6: name = " rasmussenlab-mockup"
24
- 7 # This means: Load the version from the package itself.
25
-
26
- README.md:
27
- 7
28
- 8: You will need to find and replace occurences of ` mockup` with the name of your package. This still might
29
- 9 need further testing.
30
-
31
- 22
32
- 23: Install vom [TestPyPI](https://test.pypi.org/project/rasmussenlab-mockup):
33
- 24
34
- 25 ` ` `
35
- 26: pip install -i https://test.pypi.org/simple/ rasmussenlab-mockup
36
- 27 ` ` `
37
- 28
38
- 29: > The package on PyPI is call ` rasmussenlab-mockup` and not ` mockup` as the package name is already taken. The import is still ` import mockup` .
39
- 30
40
-
41
- docs\c onf.py:
42
- 18
43
- 19: project = " mockup"
44
- 20 copyright = " 2024, Jakob Nybo Nissen, Henry Webel"
45
- 21 author = " Jakob Nybo Nissen, Henry Webel"
46
- 22: PACKAGE_VERSION = metadata.version(" rasmussenlab-mockup" )
47
- 23 version = PACKAGE_VERSION
48
-
49
- 119 PROJECT_ROOT = Path(__file__).parent.parent
50
- 120: PACKAGE_ROOT = PROJECT_ROOT / " src" / " mockup"
51
- 121
52
-
53
- docs\i ndex.rst:
54
- 1: .. mockup documentation master file, created by
55
- 2 sphinx-quickstart on Mon Aug 28 14:09:15 2023.
56
-
57
- 5
58
- 6: The mockup package
59
- 7 ==================================
60
- 8
61
- 9: Mockup is a Python package with some simple example code.
62
- 10: To get started, explore the :class:` mockup.Circle` class.
63
- 11
64
-
65
- docs\R EADME.md:
66
- 27 # apidoc
67
- 28: sphinx-apidoc --force --implicit-namespaces --module-first -o reference ../src/mockup
68
- 29 # build docs
69
-
70
- docs\t utorial\t utorial.ipynb:
71
- 6 " source" : [
72
- 7: " # Mockup tutorial"
73
- 8 ]
74
-
75
- 15 " source" : [
76
- 16: " from mockup import mockup"
77
- 17 ]
78
-
79
- 24 " source" : [
80
- 25: " mockup.add_one(-11)"
81
- 26 ]
82
-
83
- 33 " source" : [
84
- 34: " list(mockup.flatten_ints([[9, 11], [12], [4, 5]]))"
85
- 35 ]
86
-
87
- 42 " source" : [
88
- 43: " c2 = mockup.Circle.from_circumference(100)\n" ,
89
- 44 " round(c2.radius, 3)"
90
-
91
- src\m ockup\_ _init__.py:
92
- 6
93
- 7: __version__ = metadata.version(" rasmussenlab-mockup" )
94
- 8
95
- 9: from .mockup import add_one, Circle
96
- 10
97
-
98
- tests\t est_circle.py:
99
- 1 import unittest
100
- 2: from mockup.mockup import Circle
101
- 3
102
- ` ` `
103
-
104
- And additionally the author names:
105
-
106
- ` ` ` bash
107
- pyproject.toml:
108
- 1 [project]
109
- 2: authors = [
110
- 3 {name = " Jakob Nybo Nissen" , email = " jakobnybonissen@gmail.com" },
111
-
112
- README.md:
113
- 37 20 copyright = " 2024, Jakob Nybo Nissen, Henry Webel"
114
- 38: 21 author = " Jakob Nybo Nissen, Henry Webel"
115
- 39 22: PACKAGE_VERSION = metadata.version(" rasmussenlab-mockup" )
116
-
117
- 96
118
- 97: And additionally the author names:
119
- 98
120
-
121
- docs\c onf.py:
122
- 20 copyright = " 2024, Jakob Nybo Nissen, Henry Webel"
123
- 21: author = " Jakob Nybo Nissen, Henry Webel"
124
- 22 PACKAGE_VERSION = metadata.version(" rasmussenlab-mockup" )
125
- ` ` `
126
-
127
- > Potentially a cookiecutter could be based on this template repository.
13
+ with the name of your package and GitHub user name (or organization).
128
14
129
15
## Development environment
130
16
@@ -134,20 +20,19 @@ Install package so that new code is picked up in a restared python interpreter:
134
20
pip install -e ".[dev]"
135
21
```
136
22
137
- # # TestPyPI
23
+ ## Basic usage
138
24
139
- Install vom [TestPyPI](https://test.pypi.org/project/rasmussenlab-mockup):
140
-
141
- ` ` `
142
- pip install -i https://test.pypi.org/simple/ rasmussenlab-mockup
25
+ ``` python
26
+ from python_package import hello_world
27
+ print (python_package. __version__ )
28
+ print (hello_world( 4 ))
143
29
```
144
30
145
- > The package on PyPI is call ` rasmussenlab-mockup` and not ` mockup` as the package name is already taken. The import is still ` import mockup` .
146
-
147
31
## Readthedocs
148
32
149
- The documentation is build using readthedocs automatically. See
150
- [project on Readthedocs](https://readthedocs.org/projects/rasmussenlab-python-package/).
33
+ The documentation can be build using readthedocs automatically. See
34
+ [ project on Readthedocs] ( https://readthedocs.org/projects/rasmussenlab-python-package/ ) for the project. A new project needs
35
+ to be registered.
151
36
152
37
- make sure to enable build from PRs in the settings (advanded settings)
153
38
- checkout configuration file: [ ` .readthedocs.yaml ` ] ( .readthedocs.yaml )
0 commit comments