Move setup.cfg into pyproject.toml
This commit is contained in:
parent
78ea668487
commit
ccbc15d230
|
@ -87,7 +87,7 @@ mypy src/
|
|||
# manual
|
||||
pip install -r requirements/dev.txt
|
||||
version=0.0.2
|
||||
sed "s/^version =.*/version = $version/" setup.cfg
|
||||
sed -i "s/^version =.*/version = \"$version\"/" pyproject.toml
|
||||
python -m build
|
||||
git tag -a "v$version" -m "# version $version"
|
||||
python -m twine upload dist/*
|
||||
|
|
|
@ -1,3 +1,24 @@
|
|||
[build-system]
|
||||
requires = ['setuptools>=42']
|
||||
build-backend = 'setuptools.build_meta'
|
||||
|
||||
[tool.setuptools]
|
||||
packages = ["twnet_parser"]
|
||||
|
||||
[project]
|
||||
name = "twnet_parser"
|
||||
version = "0.3.0"
|
||||
authors = [
|
||||
{name = "ChillerDragon", email = "chillerdragon@gmail.com"},
|
||||
]
|
||||
description = "A teeworlds network protocol library, designed according to sans I/O (http://sans-io.readthedocs.io/) principles"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.8"
|
||||
classifiers = [
|
||||
"Development Status :: 3 - Alpha",
|
||||
"License :: OSI Approved :: BSD License",
|
||||
"Natural Language :: English",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python :: 3"
|
||||
]
|
||||
dependencies = []
|
||||
|
|
|
@ -5,9 +5,9 @@ then
|
|||
echo "Error: ./scripts/run_tests.sh not found"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f setup.cfg ]
|
||||
if [ ! -f pyproject.toml ]
|
||||
then
|
||||
echo "Error: setup.cfg not found"
|
||||
echo "Error: pyproject.toml not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -186,7 +186,7 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Do not update setup.cfg
|
||||
# Do not update pyproject.toml
|
||||
# if the build fails anyways
|
||||
if ! python -m build
|
||||
then
|
||||
|
@ -194,14 +194,14 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "[*] updating version in setup.cfg ..."
|
||||
echo "[*] updating version in pyproject.toml ..."
|
||||
# can safely be ran multiple times
|
||||
sed -i "s/^version =.*/version = ${tag_name:1}/" setup.cfg
|
||||
sed -i "s/^version =.*/version = \"${tag_name:1}\"/" pyproject.toml
|
||||
|
||||
echo "[*] wiping old dist ..."
|
||||
[[ -d dist ]] && rm -rf dist
|
||||
|
||||
# Try build again after setup.cfg update
|
||||
# Try build again after pyproject.toml update
|
||||
if ! python -m build
|
||||
then
|
||||
echo "Error: build failed"
|
||||
|
@ -226,16 +226,16 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if ! git add setup.cfg
|
||||
if ! git add pyproject.toml
|
||||
then
|
||||
echo "Error: git add failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(git diff HEAD --name-only)" != "setup.cfg" ]
|
||||
if [ "$(git diff HEAD --name-only)" != "pyproject.toml" ]
|
||||
then
|
||||
echo "Error: unexpected files would be included in the commit"
|
||||
git diff HEAD --name-only | grep -v '^setup.cfg$' | awk '{ print " " $0 }'
|
||||
git diff HEAD --name-only | grep -v '^pyproject.toml$' | awk '{ print " " $0 }'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
21
setup.cfg
21
setup.cfg
|
@ -1,21 +0,0 @@
|
|||
[metadata]
|
||||
name = twnet_parser
|
||||
version = 0.3.0
|
||||
author = ChillerDragon
|
||||
author_email = chillerdragon@gmail.com
|
||||
description = A teeworlds network protocol library, designed according to sans I/O (http://sans-io.readthedocs.io/) principles
|
||||
long_description = file: README.md, LICENSE.txt
|
||||
long_description_content_type = text/markdown
|
||||
url = https://gitlab.com/teeworlds-network/twnet_parser
|
||||
license = BSD-2.0
|
||||
project_urls =
|
||||
Bug Tracker = https://gitlab.com/teeworlds-network/twnet_parser/-/issues
|
||||
repository = https://gitlab.com/teeworlds-network/twnet_parser
|
||||
classifiers =
|
||||
Programming Language :: Python :: 3
|
||||
License :: OSI Approved :: BSD License
|
||||
Operating System :: OS Independent
|
||||
|
||||
[files]
|
||||
packages = twnet_parser
|
||||
|
Loading…
Reference in a new issue