Skip to content

Commit

Permalink
Move to pyproject.toml, instead of setup.py (#5821)
Browse files Browse the repository at this point in the history
  • Loading branch information
bblommers authored Jan 6, 2023
1 parent 89fdf9d commit 79a0b90
Show file tree
Hide file tree
Showing 13 changed files with 253 additions and 191 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }}-4
key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.cfg') }}-4
- name: Update pip
if: ${{ steps.pip-cache.outputs.cache-hit != 'true' }}
run: |
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }}-4
key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.cfg') }}
# Update PIP
- name: Update pip
run: |
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }}-4
key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.cfg') }}
- name: Update pip
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -133,7 +133,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Start MotoServer
run: |
python setup.py sdist
pip install build
python -m build
docker run --rm -t --name motoserver -e TEST_SERVER_MODE=true -e AWS_SECRET_ACCESS_KEY=server_secret -e AWS_ACCESS_KEY_ID=server_key -v `pwd`:/moto -p 5000:5000 -v /var/run/docker.sock:/var/run/docker.sock python:3.7-buster /moto/scripts/ci_moto_server.sh &
python scripts/ci_wait_for_server.py
- name: Get pip cache dir
Expand All @@ -144,7 +145,7 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }}-4
key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.cfg') }}
- name: Update pip
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -196,9 +197,9 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Update & Build
run: |
pip install wheel packaging
pip install build
python update_version_from_git.py
python setup.py sdist bdist_wheel
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/dockertests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Start MotoServer on an unusual port
run: |
python setup.py sdist
pip install --upgrade build
python -m build
docker run --rm -t --name motoserver -e TEST_SERVER_MODE=true -e AWS_SECRET_ACCESS_KEY=server_secret -e MOTO_PORT=4555 -e AWS_ACCESS_KEY_ID=server_key -v `pwd`:/moto -p 4555:4555 -v /var/run/docker.sock:/var/run/docker.sock python:3.7-buster /moto/scripts/ci_moto_server.sh &
MOTO_PORT=4555 python scripts/ci_wait_for_server.py
- name: Get pip cache dir
Expand Down Expand Up @@ -111,7 +112,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Start MotoServer on a custom Docker network bridge
run: |
python setup.py sdist
pip install --upgrade build
python -m build
docker network create -d bridge my-custom-network
docker run --rm -t -e TEST_SERVER_MODE=true -e MOTO_DOCKER_NETWORK_NAME=my-custom-network -e AWS_SECRET_ACCESS_KEY=server_secret -e AWS_ACCESS_KEY_ID=server_key -v `pwd`:/moto -p 5000:5000 --network my-custom-network -v /var/run/docker.sock:/var/run/docker.sock python:3.7-buster /moto/scripts/ci_moto_server.sh &
python scripts/ci_wait_for_server.py
Expand Down Expand Up @@ -168,7 +170,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Start MotoServer on an unusual port
run: |
python setup.py sdist
pip install --upgrade build
python -m build
docker run --rm -t -e MOTO_DOCKER_NETWORK_MODE=host -e TEST_SERVER_MODE=true -e AWS_SECRET_ACCESS_KEY=server_secret -e MOTO_PORT=4555 -e AWS_ACCESS_KEY_ID=server_key -v `pwd`:/moto -p 4555:4555 -v /var/run/docker.sock:/var/run/docker.sock python:3.7-buster /moto/scripts/ci_moto_server.sh &
MOTO_PORT=4555 python scripts/ci_wait_for_server.py
- name: Get pip cache dir
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel setuptools packaging twine --upgrade
pip install wheel setuptools packaging twine build --upgrade
- name: Verify Tag does not exist
run: |
! git rev-parse ${{ env.VERSION }} || { echo "Ensure that no tag exists for ${{ env.VERSION }}" ; exit 1; }
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set version number
run: python update_version_from_git.py ${{ env.VERSION }}
- name: Build
run: python setup.py sdist bdist_wheel
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_outdated_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Start MotoServer
run: |
python setup.py sdist
python -m build
docker run --rm -t --name motoserver -e TEST_SERVER_MODE=true -e AWS_SECRET_ACCESS_KEY=server_secret -e AWS_ACCESS_KEY_ID=server_key -v `pwd`:/moto -p 5000:5000 -v /var/run/docker.sock:/var/run/docker.sock python:3.7-buster /moto/scripts/ci_moto_server.sh &
python scripts/ci_wait_for_server.py
- name: Test ServerMode/Coverage
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
python-version: "3.8"
- name: Start MotoServer
run: |
pip install PyYAML
python setup.py sdist
pip install PyYAML build
python -m build
docker run --rm -t --name motoserver -e TEST_SERVER_MODE=true -e MOTO_PORT=4566 -e AWS_SECRET_ACCESS_KEY=server_secret -e AWS_ACCESS_KEY_ID=server_key -v `pwd`:/moto -p 4566:4566 -v /var/run/docker.sock:/var/run/docker.sock python:3.7-buster /moto/scripts/ci_moto_server.sh &
MOTO_PORT=4566 python scripts/ci_wait_for_server.py
- name: Download Cache
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include README.md LICENSE AUTHORS.md
include requirements.txt requirements-dev.txt tox.ini
include requirements.txt requirements-dev.txt
include moto/config/resources/aws_managed_rules.json
include moto/ec2/_models/*.py
include moto/ec2/resources/instance_types.json
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ else
endif

init:
@python setup.py develop
@pip install -e .
@pip install -r requirements-dev.txt

lint:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If you want to install ``moto`` from source::

git clone git://github.com/spulec/moto.git
cd moto
python setup.py install
pip install '.[all]'


Moto usage
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools >= 40.6.0", "wheel"]
build-backend = "setuptools.build_meta"
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ inflection
lxml
mypy
packaging
build
prompt_toolkit
211 changes: 211 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,214 @@
[metadata]
name = moto
version = 4.1.0.dev
long_description = file:README.md
long_description_content_type = text/markdown
author = Steve Pulec
author_email = "[email protected]"
url = https://github.com/spulec/moto
license = Apache License 2.0
test_suite = tests
classifiers =
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
License :: OSI Approved :: Apache Software License
Topic :: Software Development :: Testing
keywords = aws ec2 s3 boto3 mock
project_urls =
Documentation = http://docs.getmoto.org/en/latest/
Issue tracker = https://github.com/spulec/moto/issues
Changelog = https://github.com/spulec/moto/blob/master/CHANGELOG.md

[options]
python_requires = >=3.7
install_requires =
boto3>=1.9.201
botocore>=1.12.201
cryptography>=3.3.1
requests>=2.5
xmltodict
werkzeug>=0.5,!=2.2.0,!=2.2.1
python-dateutil<3.0.0,>=2.1
responses>=0.13.0
Jinja2>=2.10.1
importlib_metadata ; python_version < '3.8'
package_dir =
moto = moto
include_package_data = True

[options.extras_require]
all =
python-jose[cryptography]>=3.1.0,<4.0.0
ecdsa!=0.15
docker>=2.5.1
graphql-core
PyYAML>=5.1
cfn-lint>=0.40.0
sshpubkeys>=3.1.0
openapi-spec-validator>=0.2.8
pyparsing>=3.0.7
jsondiff>=1.1.2
aws-xray-sdk!=0.96,>=0.93
setuptools
server =
python-jose[cryptography]>=3.1.0,<4.0.0
ecdsa!=0.15
docker>=2.5.1
graphql-core
PyYAML>=5.1
cfn-lint>=0.40.0
sshpubkeys>=3.1.0
openapi-spec-validator>=0.2.8
pyparsing>=3.0.7
jsondiff>=1.1.2
aws-xray-sdk!=0.96,>=0.93
setuptools
flask!=2.2.0,!=2.2.1
flask-cors
acm =
acmpca =
amp =
apigateway =
PyYAML>=5.1
python-jose[cryptography]>=3.1.0,<4.0.0
ecdsa!=0.15
openapi-spec-validator>=0.2.8
apigatewayv2 = PyYAML>=5.1
applicationautoscaling =
appsync = graphql-core
athena =
autoscaling =
awslambda = docker>=2.5.1
batch = docker>=2.5.1
batch_simple =
budgets =
ce =
cloudformation =
python-jose[cryptography]>=3.1.0,<4.0.0
ecdsa!=0.15
docker>=2.5.1
graphql-core
PyYAML>=5.1
cfn-lint>=0.40.0
sshpubkeys>=3.1.0
openapi-spec-validator>=0.2.8
pyparsing>=3.0.7
jsondiff>=1.1.2
aws-xray-sdk!=0.96,>=0.93
setuptools
cloudfront =
cloudtrail =
cloudwatch =
codebuild =
codecommit =
codepipeline =
cognitoidentity =
cognitoidp =
python-jose[cryptography]>=3.1.0,<4.0.0
ecdsa!=0.15
comprehend =
config =
databrew =
datapipeline =
datasync =
dax =
dms =
ds = sshpubkeys>=3.1.0
dynamodb = docker>=2.5.1
dynamodbstreams = docker>=2.5.1
ebs = sshpubkeys>=3.1.0
ec2 = sshpubkeys>=3.1.0
ec2instanceconnect =
ecr =
ecs =
efs = sshpubkeys>=3.1.0
eks =
elasticache =
elasticbeanstalk =
elastictranscoder =
elb =
elbv2 =
emr =
emrcontainers =
emrserverless =
es =
events =
firehose =
forecast =
glacier =
glue = pyparsing>=3.0.7
greengrass =
guardduty =
iam =
iot =
iotdata = jsondiff>=1.1.2
kinesis =
kinesisvideo =
kinesisvideoarchivedmedia =
kms =
logs =
managedblockchain =
mediaconnect =
medialive =
mediapackage =
mediastore =
mediastoredata =
meteringmarketplace =
mq =
opsworks =
organizations =
personalize =
pinpoint =
polly =
quicksight =
ram =
rds =
redshift =
redshiftdata =
rekognition =
resourcegroups =
resourcegroupstaggingapi =
route53 =
route53resolver = sshpubkeys>=3.1.0
s3 = PyYAML>=5.1
s3control =
sagemaker =
sdb =
secretsmanager =
servicediscovery =
servicequotas =
ses =
signer =
sns =
sqs =
ssm =
PyYAML>=5.1
ssoadmin =
stepfunctions =
sts =
support =
swf =
textract =
timestreamwrite =
transcribe =
wafv2 =
# XRay module uses pkg_resources, but doesn't have an explicit dependency listed. This is fixed in 2.9.0:
# https://github.com/aws/aws-xray-sdk-python/issues/305
xray =
aws-xray-sdk!=0.96,>=0.93
setuptools

[options.entry_points]
console_scripts =
moto_server = moto.server:main

[bdist_wheel]
universal=1

[tool:pytest]
markers =
network: marks tests which require network connection
Expand Down
Loading

0 comments on commit 79a0b90

Please sign in to comment.