Merge branch 'master' into 'master'

Update to python3

Closes #135

See merge request phyks/Flatisfy!41
This commit is contained in:
Phyks 2021-01-03 12:46:44 +01:00
commit 8f24ed48a3
5 changed files with 20 additions and 27 deletions

View File

@ -1,29 +1,17 @@
before_script:
- "pip install -r requirements.txt"
- "pip install pylint"
- "curl -sL https://deb.nodesource.com/setup_6.x | bash -"
- "curl -sL https://deb.nodesource.com/setup_10.x | bash -"
- "apt-get install -y nodejs jq"
- "npm install"
lint:2.7:
image: "python:2.7"
stage: "test"
script:
- "hooks/pre-commit"
lint:3:
lint:
image: "python:3"
stage: "test"
script:
- "hooks/pre-commit"
test:2.7:
image: "python:2.7"
stage: "test"
script:
- python -m flatisfy init-config | jq '.constraints.default.house_types = ["APART"] | .constraints.default.type = "RENT" | .constraints.default.postal_codes = ["75014"]' > /tmp/config.json
- python -m flatisfy test --config /tmp/config.json
test:3:
test:
image: "python:3"
stage: "test"
script:

View File

@ -1,4 +1,4 @@
FROM python:2
FROM python:3
MAINTAINER Phyks <phyks@phyks.me>
# Setup layout.
@ -12,10 +12,10 @@ RUN apt-get update && \
# Install latest pip and python dependencies.
RUN pip install -U setuptools && \
pip install html2text simplejson BeautifulSoup
pip install html2text simplejson beautifulsoup4
# Install node.js.
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs
# Install weboob's code itself.
@ -30,11 +30,11 @@ COPY ./*.sh /home/user/
# Install Flatisfy, set up directories and permissions.
RUN cd /home/user \
&& git clone https://framagit.org/phyks/Flatisfy/ ./app \
&& git clone https://framagit.org/phyks/Flatisfy.git/ ./app \
&& cd ./app \
&& pip install -r requirements.txt \
&& npm install \
&& npm run build:prod \
&& npm run build:dev \
&& mkdir -p /home/user/.local/share/flatisfy \
&& chown user:user -R /home/user \
&& chmod +x /home/user/*.sh

11
docker/docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: "3"
services:
app:
build: .
# image: phyks/flatisfy
environment:
- LOCAL_USER_ID=1000
volumes:
- ./data:/flatisfy
ports:
- "8080:8080"

View File

@ -16,10 +16,7 @@ from flatisfy.models.postal_code import PostalCode
from flatisfy.models.public_transport import PublicTransport
from flatisfy.tools import normalize_string
if sys.version_info >= (3, 0):
import csv
else:
from backports import csv
import csv
LOGGER = logging.getLogger(__name__)

View File

@ -1,12 +1,9 @@
alembic
appdirs
arrow
backports.csv; python_version < '3.0'
bottle
bottle-sqlalchemy
canister
enum34; python_version < '3.4'
functools32; python_version < '3.2.3'
future
imagehash
mapbox