Skip to content

Commit

Permalink
add setup.cfg and update build configuration (#4778)
Browse files Browse the repository at this point in the history
  • Loading branch information
thrau committed Oct 22, 2021
1 parent 409f89b commit 49de1ca
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 49 deletions.
14 changes: 3 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,10 @@ jobs:
sudo apt-get install -y libsasl2-dev python3.8-venv python3.8-dev
- run:
name: Setup environment
environment:
VENV_BIN: "/usr/bin/python3.8 -m venv"
command: |
/usr/bin/python3.8 -m venv .venv
source .venv/bin/activate
which python
realpath $(which python)
# Note: pinning pip version for now, as pip-21.3.1 raises 'ModuleNotFoundError' in setup.py
pip install pip==21.3
pip install wheel setuptools
pip install -e ".[cli,runtime,test,dev]"
python -m localstack.services.install libs
python -m localstack.services.install testlibs
make entrypoints
make install
mkdir -p target/reports
mkdir -p target/coverage
- save_cache:
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN apk add iputils
RUN pip install --upgrade pip wheel setuptools localstack-plugin-loader

# add configuration and source files
ADD Makefile setup.py requirements.txt ./
ADD Makefile setup.cfg setup.py requirements.txt pyproject.toml ./
ADD localstack/ localstack/
ADD bin/localstack bin/localstack
# necessary for running pip install -e
Expand All @@ -46,6 +46,9 @@ RUN make init-testlibs
ADD localstack/infra/stepfunctions localstack/infra/stepfunctions
RUN make init

# build plugin enrypoints for localstack
RUN make entrypoints

# install supervisor config file and entrypoint script
ADD bin/supervisord.conf /etc/supervisord.conf
ADD bin/docker-entrypoint.sh /usr/local/bin/
Expand Down Expand Up @@ -90,8 +93,6 @@ RUN ES_BASE_DIR=localstack/infra/elasticsearch; \

# run tests (to verify the build before pushing the image)
ADD tests/ tests/
# add configuration files
ADD pyproject.toml ./
# fixes a dependency issue with pytest and python3.7 https://github.com/pytest-dev/pytest/issues/5594
RUN pip uninstall -y argparse dataclasses
RUN LAMBDA_EXECUTOR=local \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LocalStack project configuration
[build-system]
requires = ['setuptools', 'wheel', 'localstack-plugin-loader>=0.1.0']
requires = ['setuptools', 'wheel', 'localstack-plugin-loader']
build-backend = "setuptools.build_meta"

[tool.black]
Expand Down
22 changes: 22 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[metadata]
name = localstack
description = LocalStack - A fully functional local Cloud stack
url = https://github.com/localstack/localstack
version = attr: localstack.__version__
author = Waldemar Hummer
author_email = waldemar.hummer@gmail.com
license = Apache License 2.0
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
License :: OSI Approved :: Apache Software License
Topic :: Internet
Topic :: Software Development :: Testing
Topic :: System :: Emulators

[options]
zip_safe = False
34 changes: 0 additions & 34 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#!/usr/bin/env python
import os
import re
from collections import defaultdict

from plugin.setuptools import load_entry_points
from setuptools import find_packages, setup

import localstack


def parse_requirements(lines):
requirements = defaultdict(list)
Expand All @@ -30,9 +27,6 @@ def parse_requirements(lines):
return requirements


# determine version
version = localstack.__version__

# define package data
package_data = {
"": ["Makefile", "*.md"],
Expand All @@ -48,14 +42,6 @@ def parse_requirements(lines):
],
}

# load README.md as long description
if os.path.isfile("README.md"):
with open("README.md", "r") as fh:
long_description = fh.read()
else:
# may happen in foreign build environments (like Docker)
long_description = ""

# determine requirements
with open("requirements.txt") as f:
req = parse_requirements(f.readlines())
Expand All @@ -72,31 +58,11 @@ def parse_requirements(lines):

if __name__ == "__main__":
setup(
name="localstack",
version=version,
description="LocalStack - A fully functional local Cloud stack",
long_description=long_description,
long_description_content_type="text/markdown",
author="Waldemar Hummer",
author_email="waldemar.hummer@gmail.com",
url="https://github.com/localstack/localstack",
scripts=["bin/localstack", "bin/localstack.bat"],
packages=find_packages(exclude=("tests", "tests.*")),
package_data=package_data,
install_requires=install_requires,
extras_require=extras_require,
entry_points=load_entry_points(exclude=("tests", "tests.*")),
test_suite="tests",
license="Apache License 2.0",
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: Apache Software License",
"Topic :: Internet",
"Topic :: Software Development :: Testing",
"Topic :: System :: Emulators",
],
)

0 comments on commit 49de1ca

Please sign in to comment.