Name | ft-yde-goes-package JSON |
Version |
0.0.2
JSON |
| download |
home_page | None |
Summary | A sample test package |
upload_time | 2024-08-18 00:55:28 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2024 Ygor G. Sena Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
42school
ft_package
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
### Introduction to the ft_yde_goes_package
This package was created as a requirement to the last exercise of Day 00 during the Python for Data Science piscine at 42 School. The objective was to teach the students how to create a Python package and how to distribute it.
### Package structure
```
packaging_tutorial/
├── LICENSE
├── pyproject.toml
├── README.md
├── src/
│ └── example_package_YOUR_USERNAME_HERE/
│ ├── __init__.py
│ └── example.py
└── tests/
```
Above is the package structure used as a reference:
- `__init.py__`: this file must located at each sub-directory, which is also the sub-module of a given package. It will map all the methods present in each sub-module;
- `pyproject.toml`: contains the key-value configuration of the package with all its related information to build it. It's also possible to use a `setup.py` or `setup.cfg` instead.
### How to test the package
To test the package, run the command below at the same folder where `pyproject.toml` is located:
```
pip install --editable .
```
To check if the package was successfully installed, run:
```
pip show -v ft-package
```
To uninstall the package, run:
```
pip uninstall <package_name>
```
Create a Python program at the same folder where `pyproject.toml` is located to see if you can use the package module without any problems when running it with `python3`.
### How to build and distribute the package
We're going to need to packages:
```
python3 -m pip install twine
python3 -m pip install build
```
Then we need to build the source distribution and the wheel, which checks if the package contains pure Python to adjust the compilation settings accordingly.
```
python3 -m build --sdist
python3 -m build --wheel
```
To distribute the package, we need to create an account at PyPi, enable 2FA and create an API token. It's recommend to save the account information at `~/HOME/.pypirc`.
Last but not least, update the package:
```
twine upload dist/* --verbose
```
### References
[Build your first Python package](https://www.freecodecamp.org/news/build-your-first-python-package/) by [freeCodeCamp](https://www.freecodecamp.org/)
[Official PyPi Website](https://pypi.org/)
Setuptools Official Docs:
- [Writing your pyproject.toml](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#)
- [Packaging and distributing projects](https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#packaging-and-distributing-projects)
Raw data
{
"_id": null,
"home_page": null,
"name": "ft-yde-goes-package",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Ygor de Goes Sena <yde-goes@student.42sp.org.br>",
"keywords": "42school, ft_package",
"author": null,
"author_email": "Ygor de Goes Sena <yde-goes@student.42sp.org.br>",
"download_url": "https://files.pythonhosted.org/packages/ca/f8/1a26da6a5e7121df01d7e0ed76a877ba37913351cb34a5ca01a7ce870dd2/ft_yde_goes_package-0.0.2.tar.gz",
"platform": null,
"description": "### Introduction to the ft_yde_goes_package\n\nThis package was created as a requirement to the last exercise of Day 00 during the Python for Data Science piscine at 42 School. The objective was to teach the students how to create a Python package and how to distribute it.\n\n### Package structure\n\n```\npackaging_tutorial/\n\u251c\u2500\u2500 LICENSE\n\u251c\u2500\u2500 pyproject.toml\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 src/\n\u2502 \u2514\u2500\u2500 example_package_YOUR_USERNAME_HERE/\n\u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u2514\u2500\u2500 example.py\n\u2514\u2500\u2500 tests/\n```\n\nAbove is the package structure used as a reference:\n- `__init.py__`: this file must located at each sub-directory, which is also the sub-module of a given package. It will map all the methods present in each sub-module;\n- `pyproject.toml`: contains the key-value configuration of the package with all its related information to build it. It's also possible to use a `setup.py` or `setup.cfg` instead.\n\n### How to test the package\n\nTo test the package, run the command below at the same folder where `pyproject.toml` is located:\n```\npip install --editable .\n```\n\nTo check if the package was successfully installed, run:\n```\npip show -v ft-package\n```\n\nTo uninstall the package, run:\n```\npip uninstall <package_name>\n```\n\nCreate a Python program at the same folder where `pyproject.toml` is located to see if you can use the package module without any problems when running it with `python3`.\n\n### How to build and distribute the package\n\nWe're going to need to packages:\n\n```\npython3 -m pip install twine\npython3 -m pip install build\n```\n\nThen we need to build the source distribution and the wheel, which checks if the package contains pure Python to adjust the compilation settings accordingly.\n```\npython3 -m build --sdist\npython3 -m build --wheel\n```\n\nTo distribute the package, we need to create an account at PyPi, enable 2FA and create an API token. It's recommend to save the account information at `~/HOME/.pypirc`.\n\nLast but not least, update the package:\n```\ntwine upload dist/* --verbose\n```\n\n### References\n\n[Build your first Python package](https://www.freecodecamp.org/news/build-your-first-python-package/) by [freeCodeCamp](https://www.freecodecamp.org/)\n\n[Official PyPi Website](https://pypi.org/)\n\nSetuptools Official Docs:\n\n- [Writing your pyproject.toml](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#)\n\n- [Packaging and distributing projects](https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#packaging-and-distributing-projects)\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Ygor G. Sena Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "A sample test package",
"version": "0.0.2",
"project_urls": {
"Documentation": "https://github.com/ygor-sena/42cursus-python-for-data-science/tree/main/D00/ex09",
"Homepage": "https://github.com/ygor-sena/42cursus-python-for-data-science"
},
"split_keywords": [
"42school",
" ft_package"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a37dc1a59bc4c54cebfcaed5844da811974228111928c3105908c01640dfb181",
"md5": "69cb837508bf7e24729e770186ee5945",
"sha256": "020fe4e6e73d4c6ad4585d816989d12cbaf88b04e92b2802a2fd486f5b2d9bee"
},
"downloads": -1,
"filename": "ft_yde_goes_package-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "69cb837508bf7e24729e770186ee5945",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4554,
"upload_time": "2024-08-18T00:55:26",
"upload_time_iso_8601": "2024-08-18T00:55:26.220752Z",
"url": "https://files.pythonhosted.org/packages/a3/7d/c1a59bc4c54cebfcaed5844da811974228111928c3105908c01640dfb181/ft_yde_goes_package-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "caf81a26da6a5e7121df01d7e0ed76a877ba37913351cb34a5ca01a7ce870dd2",
"md5": "288ff009c53f8c54031560df901873e3",
"sha256": "1daf7bf5cb4dbf6029a3ed266cb0b444373478fcaf21bcd10dc44f6ead292ef1"
},
"downloads": -1,
"filename": "ft_yde_goes_package-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "288ff009c53f8c54031560df901873e3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3621,
"upload_time": "2024-08-18T00:55:28",
"upload_time_iso_8601": "2024-08-18T00:55:28.760947Z",
"url": "https://files.pythonhosted.org/packages/ca/f8/1a26da6a5e7121df01d7e0ed76a877ba37913351cb34a5ca01a7ce870dd2/ft_yde_goes_package-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-18 00:55:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ygor-sena",
"github_project": "42cursus-python-for-data-science",
"github_not_found": true,
"lcname": "ft-yde-goes-package"
}