# Make sure you have upgraded version of pip
Windows
```
py -m pip install --upgrade pip
```
Linux/MAC OS
```
python3 -m pip install --upgrade pip
```
## Create a project with the following structure
```
packaging_tutorial/
├── LICENSE
├── pyproject.toml
├── README.md
├── setup.cfg
├── src/
│ └── example_package/
│ ├── __init__.py
│ └── example.py
└── tests/
touch LICENSE
touch pyproject.toml
touch setup.cfg
mkdir src/mypackage
touch src/mypackage/__init__.py
touch src/mypackage/main.py
mkdir tests
```
## pyproject.toml
This file tells tools like pip and build how to create your project
```
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
```
build-system.requires gives a list of packages that are needed to build your package. Listing something here will only make it available during the build, not after it is installed.
build-system.build-backend is the name of Python object that will be used to perform the build. If you were to use a different build system, such as flit or poetry, those would go here, and the configuration details would be completely different than the setuptools configuration described below.
# Setup.cfg setup
Using setup.cfg is a best practice, but you could have a dynamic setup file using setup.py
```
[metadata]
name = example-pkg-YOUR-USERNAME-HERE
version = 0.0.1
author = Example Author
author_email = author@example.com
description = A small example package
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/pypa/sampleproject
project_urls =
Bug Tracker = https://github.com/pypa/sampleproject/issues
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent
[options]
package_dir =
= src
packages = find:
python_requires = >=3.6
[options.packages.find]
where = src
```
# Running the build
### Make sure your build tool is up to date
Windows
```
py -m pip install --upgrade build
```
Linux/MAC OS
```
python3 -m pip install --upgrade build
```
### Create the build
```
py -m build
```
### References
https://packaging.python.org/tutorials/packaging-projects/
Raw data
{
"_id": null,
"home_page": "https://github.com/pypa/sampleproject",
"name": "pytds-md5",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Sukhpartap Singh",
"author_email": "sukhpartap.singh@appliedsystems.com",
"download_url": "https://files.pythonhosted.org/packages/61/11/e27a13301a301a578def57bcfe6e08d89b022b782d97de6d68b04da6b357/pytds-md5-0.0.2.tar.gz",
"platform": null,
"description": "\n# Make sure you have upgraded version of pip\nWindows\n```\npy -m pip install --upgrade pip\n```\n\nLinux/MAC OS\n```\npython3 -m pip install --upgrade pip\n```\n\n## Create a project with the following structure\n```\npackaging_tutorial/\n\u251c\u2500\u2500 LICENSE\n\u251c\u2500\u2500 pyproject.toml\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 setup.cfg\n\u251c\u2500\u2500 src/\n\u2502 \u2514\u2500\u2500 example_package/\n\u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u2514\u2500\u2500 example.py\n\u2514\u2500\u2500 tests/\ntouch LICENSE\ntouch pyproject.toml\ntouch setup.cfg\nmkdir src/mypackage\ntouch src/mypackage/__init__.py\ntouch src/mypackage/main.py\nmkdir tests\n```\n\n## pyproject.toml \n\nThis file tells tools like pip and build how to create your project\n\n```\n[build-system]\nrequires = [\n \"setuptools>=42\",\n \"wheel\"\n]\nbuild-backend = \"setuptools.build_meta\"\n```\nbuild-system.requires gives a list of packages that are needed to build your package. Listing something here will only make it available during the build, not after it is installed.\n\nbuild-system.build-backend is the name of Python object that will be used to perform the build. If you were to use a different build system, such as flit or poetry, those would go here, and the configuration details would be completely different than the setuptools configuration described below.\n\n\n# Setup.cfg setup\nUsing setup.cfg is a best practice, but you could have a dynamic setup file using setup.py\n\n```\n[metadata]\nname = example-pkg-YOUR-USERNAME-HERE\nversion = 0.0.1\nauthor = Example Author\nauthor_email = author@example.com\ndescription = A small example package\nlong_description = file: README.md\nlong_description_content_type = text/markdown\nurl = https://github.com/pypa/sampleproject\nproject_urls =\n Bug Tracker = https://github.com/pypa/sampleproject/issues\nclassifiers =\n Programming Language :: Python :: 3\n License :: OSI Approved :: MIT License\n Operating System :: OS Independent\n\n[options]\npackage_dir =\n = src\npackages = find:\npython_requires = >=3.6\n\n[options.packages.find]\nwhere = src\n\n```\n# Running the build\n### Make sure your build tool is up to date\nWindows\n```\npy -m pip install --upgrade build\n```\nLinux/MAC OS\n```\npython3 -m pip install --upgrade build\n```\n\n\n### Create the build\n```\npy -m build\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n### References\nhttps://packaging.python.org/tutorials/packaging-projects/\n",
"bugtrack_url": null,
"license": "",
"summary": "A small example package",
"version": "0.0.2",
"project_urls": {
"Bug Tracker": "https://github.com/pypa/sampleproject/issues",
"Homepage": "https://github.com/pypa/sampleproject"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3b7622da2b850aa638f7ce5c6bc3517e1d60023b8cc9df618475f32b59718988",
"md5": "a41fcaa13df898e784c21787d7ab673a",
"sha256": "183ba8ed24a78770a39d4c64b2743c362a3dac376a32eae789e0861354f1e39e"
},
"downloads": -1,
"filename": "pytds_md5-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a41fcaa13df898e784c21787d7ab673a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 71049,
"upload_time": "2023-08-18T22:21:41",
"upload_time_iso_8601": "2023-08-18T22:21:41.108766Z",
"url": "https://files.pythonhosted.org/packages/3b/76/22da2b850aa638f7ce5c6bc3517e1d60023b8cc9df618475f32b59718988/pytds_md5-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6111e27a13301a301a578def57bcfe6e08d89b022b782d97de6d68b04da6b357",
"md5": "aacdaaf1ae50fc2bf0021f193c4c317b",
"sha256": "cca6e64d5f20dcceadaa3ed0d01e6fda636c29d2119562e8b9c191b09fa4c882"
},
"downloads": -1,
"filename": "pytds-md5-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "aacdaaf1ae50fc2bf0021f193c4c317b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 68326,
"upload_time": "2023-08-18T22:21:46",
"upload_time_iso_8601": "2023-08-18T22:21:46.698154Z",
"url": "https://files.pythonhosted.org/packages/61/11/e27a13301a301a578def57bcfe6e08d89b022b782d97de6d68b04da6b357/pytds-md5-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-18 22:21:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pypa",
"github_project": "sampleproject",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "pytds-md5"
}