# 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": "ntlm-auth-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/f9/15/b8789ff203a532ddb0b2a31cf9ded6fcd592b961310a78822dd2cf33df86/ntlm-auth-md5-0.0.1.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.1",
"project_urls": {
"Bug Tracker": "https://github.com/pypa/sampleproject/issues",
"Homepage": "https://github.com/pypa/sampleproject"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4301e153aa86dfbb7646492d84a5018eb0ea2d93c7d9abce0910c798bce5aaf7",
"md5": "00c4927b7017e7d23c188aca7a378b5b",
"sha256": "c7b4f49e83140fb8a4cb626c75bd0d2853a9246f7c1c7a7a445e5db66acc0eff"
},
"downloads": -1,
"filename": "ntlm_auth_md5-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "00c4927b7017e7d23c188aca7a378b5b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 27281,
"upload_time": "2023-08-18T19:30:55",
"upload_time_iso_8601": "2023-08-18T19:30:55.474061Z",
"url": "https://files.pythonhosted.org/packages/43/01/e153aa86dfbb7646492d84a5018eb0ea2d93c7d9abce0910c798bce5aaf7/ntlm_auth_md5-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f915b8789ff203a532ddb0b2a31cf9ded6fcd592b961310a78822dd2cf33df86",
"md5": "2b8d739b3d60c11708634abf73882780",
"sha256": "940ec5f87379b89292cff392c2367967a8372151828cfa253c11e8b16f3e3bb9"
},
"downloads": -1,
"filename": "ntlm-auth-md5-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "2b8d739b3d60c11708634abf73882780",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 22654,
"upload_time": "2023-08-18T19:30:57",
"upload_time_iso_8601": "2023-08-18T19:30:57.418254Z",
"url": "https://files.pythonhosted.org/packages/f9/15/b8789ff203a532ddb0b2a31cf9ded6fcd592b961310a78822dd2cf33df86/ntlm-auth-md5-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-18 19:30:57",
"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": "ntlm-auth-md5"
}