Skip to content

Commit d3edc5c

Browse files
authored
Code flake linted and all instructions for --use-pep517 (#498)
1 parent 923ee23 commit d3edc5c

29 files changed

Lines changed: 258 additions & 281 deletions

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ indent_size = 2
1616
[*.yaml]
1717
indent_size = 2
1818

19+
[*.json]
20+
indent_size = 2
21+
1922
[*.toml]
2023
indent_size = 2
2124

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,21 @@ servedocs: docs ## compile the docs watching for changes
113113

114114
release: dist ## package and upload a release
115115
twine check dist/*
116-
twine upload dist/*
116+
poetry publish --build
117117

118118
release-test: dist ## package and upload a release
119119
twine check dist/* || echo Failed to validate release
120-
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
121-
120+
poetry config repositories.pypitest https://test.pypi.org/legacy/
121+
poetry publish -r pypitest --build
122122

123123
dist: clean ## builds source and wheel package
124-
python setup.py sdist
125-
python setup.py bdist_wheel
124+
poetry build
126125
ls -l dist
127126

128127
install: clean ## install the package to the active Python's site-packages
129-
python setup.py install
128+
pip install . --use-pep517 --use-feature=in-tree-build
130129

131130
conform : ## Conform to a standard of coding syntax
132131
isort --profile black ecs_composex
133-
black ecs_composex tests setup.py
132+
black ecs_composex tests
134133
find ecs_composex -name "*.json" -type f -exec sed -i '1s/^\xEF\xBB\xBF//' {} +

cli.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM $BASE_IMAGE as builder
66

77
WORKDIR /opt
88
COPY ecs_composex /opt/ecs_composex
9-
COPY setup.py pyproject.toml MANIFEST.in README.rst LICENSE /opt/
9+
COPY pyproject.toml poetry.lock MANIFEST.in README.rst LICENSE /opt/
1010
RUN python -m pip install pip -U ; pip install poetry ; poetry build
1111

1212
FROM $BASE_IMAGE

docs/installation.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Installation
1212
Stable release
1313
==============
1414

15-
From docker
16-
------------
15+
Using docker
16+
-------------
1717

1818
.. code-block:: console
1919
@@ -26,6 +26,14 @@ From docker
2626
From Pip
2727
---------
2828

29+
.. warning::
30+
31+
You must use pip>=21 to have all functionalities work. Simply run
32+
33+
.. code-block::
34+
35+
pip install pip -U
36+
2937
To install ECS-Compose-X, run this command in your terminal:
3038

3139
.. code-block:: console
@@ -40,6 +48,8 @@ To install ECS-Compose-X, run this command in your terminal:
4048
4149
python -m venv venv
4250
source venv/bin/activate
51+
pip install pip -U
52+
pip install ecs_composex
4353
4454
This is the preferred method to install ECS-Compose-X, as it will always install the most recent stable release.
4555

@@ -74,7 +84,10 @@ Using pip
7484
7585
# After git clone
7686
cd ecs_composex
77-
pip install .
87+
python -m venv venv
88+
source venv/bin/activate
89+
pip install pip -U
90+
pip install . --use-pep517 --use-feature=in-tree-build
7891
7992
Using poetry
8093
-------------------
@@ -83,7 +96,10 @@ Using poetry
8396
8497
# After git clone
8598
cd ecs_composex
86-
python -m pip install poetry
99+
python -m venv venv
100+
source venv/bin/activate
101+
pip install pip -U
102+
pip install poetry
87103
poetry install
88104
89105
.. hint::

ecs_composex/alarms/alarms_ecs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from ecs_composex.alarms.alarms_stack import Alarm, create_alarms
1515
from ecs_composex.common import LOG, add_outputs, add_parameters
1616
from ecs_composex.common.cfn_params import Parameter
17-
from ecs_composex.ecs.ecs_params import CLUSTER_NAME, SERVICE_SCALING_TARGET, SERVICE_T
17+
from ecs_composex.ecs.ecs_params import CLUSTER_NAME, SERVICE_SCALING_TARGET
1818
from ecs_composex.ecs.ecs_scaling import (
1919
generate_alarm_scaling_out_policy,
2020
reset_to_zero_policy,

ecs_composex/alarms/alarms_stack.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,12 @@
99
import re
1010

1111
from compose_x_common.compose_x_common import keyisset
12-
from troposphere import (
13-
AWS_REGION,
14-
AWS_STACK_ID,
15-
AWS_STACK_NAME,
16-
Join,
17-
Ref,
18-
Select,
19-
Split,
20-
Sub,
21-
)
12+
from troposphere import AWS_REGION, AWS_STACK_ID, Join, Ref, Select, Split, Sub
2213
from troposphere.cloudwatch import Alarm as CWAlarm
2314
from troposphere.cloudwatch import CompositeAlarm
2415

2516
from ecs_composex.alarms.alarms_params import RES_KEY
26-
from ecs_composex.common import LOG, build_template
17+
from ecs_composex.common import build_template
2718
from ecs_composex.common.compose_resources import XResource, set_resources
2819
from ecs_composex.common.stacks import ComposeXStack
2920
from ecs_composex.resources_import import import_record_properties

ecs_composex/codeguru_profiler/codeguru_profiler_aws.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
import re
1010

11-
from botocore.exceptions import ClientError
12-
1311
from ecs_composex.codeguru_profiler.codeguru_profiler_params import (
1412
PROFILER_ARN,
1513
PROFILER_NAME,

ecs_composex/codeguru_profiler/codeguru_profiler_ecs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
def define_lookup_profile_mappings(mappings, resources, settings):
1919
"""
2020
Function to update the mappings of CodeGuru profile identified via Lookup
21-
:param mappings:
22-
:param resources:
21+
:param dict mappings:
22+
:param list resources:
23+
:param ecs_composex.common.settings.ComposeXSettings settings:
2324
:return:
2425
"""
2526
for res in resources:
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"RW": {
3-
"Effect": "Allow",
4-
"Action": [
5-
"codeguru-profiler:ConfigureAgent",
6-
"codeguru-profiler:PostAgentProfile"
7-
]
8-
}
2+
"RW": {
3+
"Effect": "Allow",
4+
"Action": [
5+
"codeguru-profiler:ConfigureAgent",
6+
"codeguru-profiler:PostAgentProfile"
7+
]
8+
}
99
}

ecs_composex/codeguru_profiler/codeguru_profiler_stack.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,7 @@
77
"""
88

99
from compose_x_common.compose_x_common import keyisset
10-
from troposphere import (
11-
AWS_NO_VALUE,
12-
AWS_PARTITION,
13-
AWS_REGION,
14-
AWS_STACK_NAME,
15-
GetAtt,
16-
Join,
17-
Ref,
18-
Sub,
19-
)
10+
from troposphere import GetAtt, Ref, Sub
2011
from troposphere.codeguruprofiler import ProfilingGroup
2112

2213
from ecs_composex.codeguru_profiler.codeguru_profiler_params import (

0 commit comments

Comments
 (0)