Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
restructure to make ready for version 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvaintouret committed Sep 20, 2022
1 parent 9b995e4 commit d8e2d12
Show file tree
Hide file tree
Showing 9 changed files with 586 additions and 196 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ labonneboite/web/static/gen/
# virtualenv
venv/
logs/
__pycache__
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
restart: always
build:
context: .
dockerfile: docker/v3.6/Dockerfile
args:
options: --reload
environment:
Expand Down
42 changes: 42 additions & 0 deletions docker/v3.10/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM python:3.10.7-slim-bullseye


# Set timezone
ENV TZ=Europe/Paris
ENV FLASK_APP web.app

# for mysql support & git & french langage support
RUN apt update && apt install -y \
git \
python3-dev \
default-libmysqlclient-dev \
build-essential \
locales \
--no-install-recommends

# switch working directory
WORKDIR /app
RUN mkdir -p /app/logs

# Installing requirements
# COPY docker/v3.6/requirements.txt /requirements.txt
# RUN pip install -r /requirements.txt

# File imports : source code
COPY docker/v3.10/ /app/
COPY ./labonneboite /app/labonneboite
RUN pip install -e .
WORKDIR /app/labonneboite

# unsupported local error : https://stackoverflow.com/questions/54802935/docker-unsupported-locale-setting-when-running-python-container
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen \
&& locale-gen

# building flask assets
RUN flask assets build

# add the entrypoint
RUN chmod +x ./run.sh
RUN pip freeze
ENTRYPOINT ["/bin/bash", "./run.sh"]
172 changes: 172 additions & 0 deletions docker/v3.10/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
alembic==1.8.1
arabic-reshaper==2.1.3
asn1crypto==1.5.1
astroid==2.12.10
asttokens==2.0.8
async-generator==1.10
attrs==22.1.0
Babel==2.10.3
backcall==0.2.0
blinker==1.5
build==0.8.0
cachetools==5.2.0
certifi==2022.9.14
cffi==1.15.1
chardet==5.0.0
charset-normalizer==2.1.1
click==8.1.3
cryptography==38.0.1
cssmin==0.2.0
cssselect2==0.7.0
decorator==5.1.1
defusedxml==0.7.1
dill==0.3.5.1
dnspython==2.2.1
EasyProcess==1.1
ecdsa==0.18.0
elastic-transport==8.4.0
elasticsearch==8.4.1
email-validator==1.3.0
executing==1.0.0
first==2.0.2
Flask==2.2.2
Flask-Admin==1.6.0
Flask-Assets==2.0
Flask-BabelEx==0.9.4
Flask-Cors==3.0.10
Flask-DebugToolbar==0.13.1
Flask-Login==0.6.2
Flask-Script==2.0.6
Flask-Testing==0.8.1
Flask-WTF==1.0.1
future==0.18.2
geographiclib==1.52
geopy==2.2.0
gevent==21.12.0
google-api-core==2.10.1
google-api-python-client==2.62.0
google-auth==2.11.1
google-auth-httplib2==0.1.0
google-auth-oauthlib==0.5.3
googleapis-common-protos==1.56.4
greenlet==1.1.3
gunicorn==20.1.0
h11==0.13.0
html5lib==1.1
httplib2==0.20.4
idna==3.4
importlib-metadata==4.12.0
ipdb==0.13.9
ipython==8.5.0
ipython-genutils==0.2.0
isort==5.10.1
itsdangerous==2.1.2
jedi==0.18.1
Jinja2==3.1.2
jsmin==3.0.1
# Editable install with no version control (LaBonneBoite==0.2)
-e /app
labonneboite-common @ git+https://github.com/StartupsPoleEmploi/labonneboite-common.git@f0dadcbb79338522169e586a9f4ec0a750920d00
lazy-object-proxy==1.7.1
line-profiler==3.5.1
lxml==4.9.1
mailjet-rest==1.3.4
Mako==1.2.2
MarkupSafe==2.1.1
matplotlib-inline==0.1.6
mccabe==0.7.0
msgpack-python==0.5.6
mysqlclient==2.1.1
nose==1.3.7
numpy==1.23.3
oauthlib==3.2.1
oscrypto==1.3.0
outcome==1.2.0
packaging==21.3
pandas==1.5.0
parameterized==0.8.1
parso==0.8.3
pep517==0.13.0
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.2.0
pip-tools==6.8.0
platformdirs==2.5.2
prompt-toolkit==3.0.31
protobuf==4.21.6
ptyprocess==0.7.0
pure-eval==0.2.2
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
pycryptodomex==3.15.0
Pygments==2.13.0
pyHanko==0.14.0
pyhanko-certvalidator==0.19.5
pyjwkest==1.4.2
PyJWT==2.5.0
pylint==2.15.3
pyparsing==3.0.9
PyPDF2==2.10.9
PyPDF3==1.0.6
pyprof2calltree==1.4.5
PySocks==1.7.1
python-bidi==0.4.2
python-dateutil==2.8.2
python-editor==1.0.4
python-jose==3.3.0
python-slugify==6.1.2
python3-openid==3.2.0
pytz==2022.2.1
pytz-deprecation-shim==0.1.0.post0
PyVirtualDisplay==3.0
PyYAML==6.0
qrcode==7.3.1
raven==6.10.0
remote-pdb==2.1.0
reportlab==3.6.11
requests==2.28.1
requests-oauthlib==1.3.1
rsa==4.9
selenium==4.4.3
sentry-sdk==1.9.8
six==1.16.0
sniffio==1.3.0
social-auth-app-flask==1.0.0
social-auth-app-flask-sqlalchemy==1.0.1
social-auth-core==4.3.0
social-auth-storage-sqlalchemy==1.1.0
sortedcontainers==2.4.0
speaklater==1.3
SQLAlchemy==1.3.24
SQLAlchemy-Utils==0.38.3
stack-data==0.5.0
svglib==1.4.1
text-unidecode==1.3
tinycss2==1.1.1
toml==0.10.2
tomli==2.0.1
tomlkit==0.11.4
tqdm==4.64.1
traitlets==5.4.0
trio==0.21.0
trio-websocket==0.9.2
typing_extensions==4.3.0
tzdata==2022.2
tzlocal==4.2
Unidecode==0.4.21
uritemplate==4.1.1
uritools==4.0.0
urllib3==1.26.12
validators==0.20.0
wcwidth==0.2.5
webassets==2.0
webencodings==0.5.1
Werkzeug==2.2.2
wrapt==1.14.1
wsproto==1.2.0
WTForms==3.0.1
xhtml2pdf==0.2.8
zipp==3.8.1
zope.event==4.5.0
zope.interface==5.4.0
94 changes: 94 additions & 0 deletions docker/v3.10/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
##################################################
# coverage #
##################################################
[coverage:run]
branch = True
parallel = true
concurrency=multiprocessing

[coverage:report]
precision = 1
show_missing = True
ignore_errors = True
exclude_lines =
pragma: no cover
raise NotImplementedError
def __repr__
if settings.DEBUG
if __name__ == .__main__.:
if TYPE_CHECKING:
omit =
*/test*
*/migrations/*
manage.py
venv/*

##################################################
# flake8 #
##################################################
[flake8]
ignore =
W503, # line break before binary operator
D100, # Missing docstring in public module
D101, # Missing docstring in public class
D102, # Missing docstring in public method
D104, # Missing docstring in public package
D106, # Missing docstring in public nested class
D200, # One-line docstring should fit on one line with quotes
D202, # No blank lines allowed after function docstring
D204, # 1 blank line required after class docstring
D205, # 1 blank line required between summary line and description
D400, # First line should end with a period
D406 # 1 blank line required before class docstring

max-line-length = 120
max-complexity = 18
select = B,C,E,F,W,T4,B9
enable-extensions = I,A,G,D
application-import-names = api,config,post,model_utils,saas,appointment,user
import-order-style = google
docstring-convention = numpy
exclude = migrations

##################################################
# isort #
##################################################
[isort]
multi_line_output = 2
line_length = 120
order_by_type = false
force_to_top = labonneboite.conf

##################################################
# mypy #
##################################################
[mypy]
ignore_missing_imports = false
follow_imports = silent
# no_strict_optional = true
show_error_codes = true
plugins = sqlmypy
disable_error_code = no-untyped-call
strict = true

[mypy-alembic.*,astroid.*,flask_admin.*,dateutil.*,sqlalchemy_utils.*,babel.dates.*,easyprocess.*,elasticsearch.*,elasticsearch.exceptions.*,elasticsearch.helpers.*,flask_admin.*,flask_admin.contrib.sqla.*,flask_assets.*,flask_babelex.*,flask_debugtoolbar.*,flask.ext.cors.*,flask_login.*,flask_script.*,flask_testing.*,flask_wtf.*,flask_wtf.csrf.*,geopy.*,geopy.distance.*,googleapiclient.discovery.*,google_auth_oauthlib.flow.*,google.auth.transport.requests.*,ipdb.*,locust.*,mailjet_rest.*,MySQLdb.*,numpy.*,pandas.*,parameterized.*,pyprof2calltree.*,pyvirtualdisplay.*,sklearn.*,sklearn.metrics.*,social_core.*,social_core.backends.open_id_connect.*,social_core.exceptions.*,social_flask.routes.*,social_flask_sqlalchemy.models.*,social_flask.utils.*,unidecode.*,validators.*,wtforms.*,wtforms.fields.html5.*,wtforms.validators.*,wtforms.widgets.*,xhtml2pdf.*]
ignore_missing_imports = true

##################################################
# yapf #
##################################################
[yapf]
based_on_style = google
column_limit = 120
split_before_logical_operator = true
split_before_dot = true
coalesce_brackets = true
align_closing_bracket_with_visual_indent = true
allow_split_before_dict_value = false
blank_line_before_nested_class_or_def = true
blank_lines_around_top_level_definition = 2

[tool:pytest]
python_files = test_*.py
env =
LBB_ENV=test
47 changes: 47 additions & 0 deletions docker/v3.10/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import os
from setuptools import setup
import re


def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()


pip_editable_with_egg_regex = re.compile("-e (.+#egg=(.+))")


def requirement_to_install_require(requirement: str):
result = pip_editable_with_egg_regex.match(requirement)
if result:
return f"{result.group(2)} @ {result.group(1)}"
return requirement


install_requires = [
requirement_to_install_require(req) for req in open("requirements.txt")
]

setup(
name="LaBonneBoite",
version="0.2",
author="La Bonne Boite",
author_email="[email protected]",
description=(""),
packages=[
"labonneboite",
],
include_package_data=True,
install_requires=install_requires,
entry_points={
"console_scripts": [
"create_index = labonneboite.scripts.create_index:run",
],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
],
)
File renamed without changes.
Loading

0 comments on commit d8e2d12

Please sign in to comment.