Commit Graph
45 Commits
Author SHA1 Message Date
Christophe Monniez 15b6cf888c [IMP] packaging: adapt packaging for current distros
As Odoo, now, needs at least python 3.10 have to build it against the
current distros.

closes odoo/odoo#136904

Related: odoo/documentation#5940
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-06 21:11:52 +00:00
Olivier Dony 3db7956b4c [IMP] assets: switch to optimized rjsmin minification
The C implementation of the JS minification gives speedups between 6
and 55 times faster than the regex-based Python port, depending on
how compressed the input it (which is what our default implementation
does).

This is measurable when generating compiled assets bundle from scratch,
e.g. after installing/updating modules or source code.

As an illustration, the minification of a 2MB JS bundle can be 50x
faster:

```py
import rjsmin
from odoo.addons.base.models.assetsbundle import rjsmin as rjsm
js_source = open("web.assets_common_lazy.js").read() # 2MB JS
%timeit rjsm(js_source)
 # -> 339 ms ± 495 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit rjsmin.jsmin(js_source)
 # -> 6.88 ms ± 213 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
```

It's also a drop-in replacement, as long as you rjsmin 1.1.0 or better
is available (to support format strings properly, a.o.).

See also the documentation of rjsmin: http://opensource.perlig.de/rjsmin/

closes odoo/odoo#104283

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-06-05 16:16:57 +02:00
Julien Castiaux c59750d824 [IMP] core: smarter geoip
Maxmind offers multiple ip-geolocalization databases, historically we
have been using the City database which contains records on a
city-basis. Many years later it turns out we are primary using geoip to
know the country of the user. Geolocalization in the City database is
considered slow by our standard and we have been clever in order not to
geolocate each request by saving the info in the session.

On the other hand, the Country database that is offered by Maxmind is
much more lightweight and geoip using that country is considered a fast
operation by our standard.

In this work we make Odoo compatible with both the City and the Country
databases. Using multiple database at the same time, we can be smart and
only query each of the two on-demand. If a user ask for its country,
we'll use the fast Country db. If a user ask for its city/timezone we'll
use the slower City db.

By default it loads both database from the `/usr/share/GeoIP/` folder,
respectively the files `GeoLite2-City.mmdb` and `GeoLite2-Country.mmdb`,
you can provide alternative paths using the `--geoip-city-db` and
`--geoip-country-db` CLI options.

In the same mindset as #86015, geoip is still lazy. It is done on-demand
and the result is cached on the current request. The different with the
related PR is that as we know consider geoip to be fast, we no longer
cache the result in the session.

Task: 2848206
Part-of: odoo/odoo#91337
2023-01-03 13:16:02 +01:00
Thibault Delavallée 37db926fe8 [REF] various: remove usage and dependency on html2text library
We have our own html2plaintext, already used in lot of use cases instead of
just a few for the html2txt library.

Notably for emails: most emails going through Odoo stack use our simple
html2plaintext to format the body alternative. When no body alternative
is given to ``build_email`` an alternative is built using the library to
remove. Using our own parser allows to have the same results compared to
using ``MailMail.send()``. Difference lies in spaces and new lines as well
as markdown. Our html2plaintext is a bit simple and does not try to generate
Markdown but generates a simple plaintext version.

This also helps solving some issues with depending on that library.

Task-2702034

closes odoo/odoo#82486

X-original-commit: b3b9627b655cd7cb928925affed6cc8d92661e8d
Related: odoo/enterprise#23364
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-12 16:43:16 +00:00
Christophe Monniez 01949f9419 [FIX] packaging: remove mako
Mako is not used anymore for a long time.

closes odoo/odoo#78781

X-original-commit: fb9f89afbc7a22e82309150617e8b5de5c995ff9
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-10-21 19:09:48 +00:00
Christophe Monniez c5a9089461 [IMP] packaging: update packaging docker files
Manual forward-port of odoo/odoo#77759

Cherry-pick of 4e57f41bb

closes odoo/odoo#77854

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-10-11 09:02:19 +00:00
Christophe Monniez f78b6d00af [FIX] packaging: add missing dependencies
A dependency on python pyopenssl package was added in #61853 and flew
under the radar. As this package is pure python, it should not cause any
arm.

Also, it seems that the gsfonts package is needed on Debian to print
things like barcode badges. Previously, the gsfonts package was a
dependency of python3-renderm package which is itself a dependency of
odoo. The gsfonts dependency was removed in the python3-renderpm Bullseye package.

With this commit the gsfonts dependency is set on the odoo Debian
package directly.

X-original-commit: 248762c80fbf3396d44ea9b55153dcd1d36d3490
Part-of: odoo/odoo#78097
2021-10-08 22:11:47 +00:00
Nils Hamerlinck 22faf86089 [REM] packaging: remove obsolete dependency feedparser
- Up to odoo 10.0, feedparser dependency was optionally used in the cli of vendored html2text.py
  (see https://github.com/odoo/odoo/blob/10.0/addons/mail/models/html2text.py#L437)
- Since 11.0 (67c17cb3), vendored html2text.py has been removed in favor of maintained package
- Turns out the feedparser part in html2text was dead code for a long time anyway
  (see https://github.com/Alir3z4/html2text/issues/220)
- So we can safely drop this dependency

closes odoo/odoo#76571

X-original-commit: 153ecbba47079982a2ec399f33bb246ba95550ba
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-09-15 14:05:04 +00:00
Christophe Monniez abdc518194 [FIX] packaging: add python3-renderpm in debian package
In Debian and Ubuntu distros, the python reportlab package provides
multiple binary packages among which python3-reportlab [0] [1] and
python3-renderpm [2] [3]. The latter is only recommended, but is mandatory for
odoo because it's needed for rendering barcode with the `asString` method.

[0] https://packages.debian.org/buster/python3-reportlab
[1] https://packages.ubuntu.com/focal/python3-reportlab
[2] https://packages.debian.org/buster/python3-renderpm
[3] https://packages.ubuntu.com/focal/python3-renderpm

closes odoo/odoo#67418

X-original-commit: 73e9926435f0b3c6eb4fe06457231aa60c8bb557
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-03-06 11:54:06 +00:00
Christophe Monniez 62f9449dbb [FIX] packaging: add zeep and ofxparse in deb and rpm packaging
Zeep replaced suds but Debian and Rpm packaging were not updated.
Ofxparse is required but did not appear in Debian nor Rpm packaging.

closes odoo/odoo#66814

X-original-commit: 280df5ac282ad3f75b74dd3e6d172ee314693c99
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-02-25 11:00:46 +00:00
Christophe Monniez 2d4c38343e [FIX] packaging: update rpm packaging for fedora 32
As Fedora 32 was the current release when Odoo 14.0 was released, this
should be the supported version.

Also, a few  old libs were still in mentioned in the packaging files.
They flew under the radar because they never broke the packaging.
This is not the case anymore, those libs disappeared from the Fedora
repos.

It seems that pyparsing is not used anymore since 5a1c06a19 and thus can
be safely removed from `requirements.txt` too.

pychart is not used anymore since 3425752ea.

While at it, remove mix of tabs and spaces in package.dffedora, also add
missing packages to avoid installation at test time.

Now that I started down the slippery slope, also removed some `-dev`
packages in package.dfsrc as wheel's are available.

Finally, the rpm install script now detects the python ABI version in
order to avoid update this file at each ABI change in Fedora.

Fixes #63719

closes odoo/odoo#65288

X-original-commit: a8deb1dd433e3a1690d593e83ade6af46326a26b
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-01-29 16:11:43 +00:00
Christophe Monniez f5e2c3cff8 [FIX] packaging: install python3-setuptools in docker
Since 5952928b42, the python3-mock debian package is removed from the
Dockerfile used to build the Debian package. This prevent the Odoo
Debian package to be built.

The python3-mock debian package has an inderect dependency on
python3-setuptools which is necessary to build the package.

With this commit, the dependency is explicitely set in the Dockerfile.

closes odoo/odoo#49278

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-04-09 08:04:46 +00:00
Adrian Torres 5952928b42 [REM] *: remove various unused import shims
Before this commit, a lot of leftover import shims existed in the
codebase for py2-py3 compatibility, these are no longer needed since
Odoo 13.0+ doesn't support Python 2 anymore and is (finally) in EOL.

With this commit, these shims are dropped, making the code cleaner,
easier to read and with one less dependency.

Queue -> queue -> py2-py3 compatibility
xmlrpclib -> xmlrpc.client -> py2-py3 compatibility
ConfigParser -> configparser -> py2-py3 compatibility
itertools.izip_longest -> itertools.zip_longest -> py2-py3 compatibility
urllib -> urllib.request -> py2-py3 compatibility
__builtins__ -> builtins -> py2-py3 compatibility
_winreg -> winreg -> py2-py3 compatibility

mock -> unittest.mock -> merged into CPython

The debian/fedora packages and requirements.txt have been updated accordingly

closes odoo/odoo#44601

Related: odoo/enterprise#8141
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-01 12:45:40 +00:00
Hardik Prajapati a43f857423 [IMP] base_vat: replace vatnumver by stdnum library.
Python module vatnumber doesn't seem maintained anymore. Therefore, we should:
    - call directly stdnum (which is maintained and mostly used everywhere in vatnumber)

Also improve stdnum import, vat fix method and vat expected formats

task-1915371

closes odoo/odoo#36978

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-02-05 10:39:39 +00:00
Christophe Monniez 8c4c439473 [REF] packaging: use docker to build packages
Actually, docker is used to test Linux packages once they are built.
The packaging process is done on the host system where package.py is
run.

Consequences:
    * difficult to reproduce an exact same build on another host
    * changing a Debian/Ubuntu target version means some upgrade steps
      on the build host (mix that with the fact that the host also
      could build old Odoo versions)
    * Fedora rpm package is built on an Ubuntu system (which is not a
      real problem but it could be)

With this commit, the package.py utility is refactored to use Docker
containers to build the Gnu/Linux packages.

Also, the Debian package is adapted for Debian Buster, the RPM package
is built based on Fedora 30.

Some minor changes are also made in the windows packaging system.

closes odoo/odoo#37766

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-10-02 14:24:53 +00:00
Christophe Monniez d858e275e3 [FIX] packaging: add missing polib packages
The use of polib as introduced in commit 632fa04.
The nightly packaging system uses Docker to test the packages and they need to
be updated when a new library dependency is introduced.

closes odoo/odoo#34117

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-06-14 07:53:33 +00:00
Christophe Monniez 51ee0c3cb5 [FIX] packaging: add qrcode package to docker file
After the Odoo package is built, the package.py script uses a Docker
image to test the package. After that python3-qrcode was added as a
dependency for the package in 2ff49c5f , it revealed some issues.

A missing cli parameter and a forgotten '&&' in the Dockerfile prevented
the installation of the depending packages.

Also, the script shebang was wrong by launching python2.

Finally, the fact that python3-xlwt is missing in Debian stretch was
highlighted. With this commit, the python3-xlwt is explicitly removed
from the dependencies and the documentation is updated accordingly.

closes odoo/odoo#28807
2018-11-19 15:34:13 +00:00
Adrian Torres a277bfb44a [REM] packaging: drop PyYAML dependency
Commit cf853a785b removed all yml tests
and the yml import engine from Odoo forever, however PyYAML remains a
dependency even though it's not used anymore.

This commit removes any reference to this lib that could be found.

closes odoo/odoo#27563
2018-10-09 12:56:03 +00:00
Christophe Monniez ddf601d443 [FIX] packaging: remove libsass dependency in debian package
A dependency to libsass was added in debian package and in the docker
file. The Odoo nightly builds of the deb package was failing because
this lib is named libsass0 in Debian.

Finally, this dependency is not required because python3-libsass already depends on libsass0.
2018-04-24 13:51:13 +02:00
qsm-odoo bf3193ac5e [REF] setup: review dependencies
Include libsass instead of node-less

Thank you to @d-fence for testing this.
2018-04-18 15:58:34 +02:00
Christophe Monniez 5dfa00cb6c [FIX] packages: fix docker images builds tests
The automated tests of rpm,deb and src packages are using docker
images and containers. Those tests were not working as expected due
to various small glitches:
* some debian python- packages were missing in the Debian image
* pip was called instead of pip3 for the src test
* a wrong addons path was given for the tests
* the containers id's were wrong due to a bytes implicitly converted
  to str
2017-10-12 17:24:36 +02:00
Christophe Monniez fc76b1d565 [REM] remove any openid reference
Purpose: openid is not used anymore in Odoo, therefore it can be
safely removed.
2017-10-12 08:43:21 +02:00
Christophe Monniez 6953f22e67 [IMP] setup: Update docker files 2017-10-03 12:01:53 +02:00
Christophe Simonis b350c29e44 [FIX] setup: install html2text dependency 2017-06-09 15:48:49 +02:00
Olivier Dony 345f1d4b86 [FIX] packaging: update dependency for pyPdf2
Complements 021de21e8c and #16918
2017-05-26 15:45:39 +02:00
Christophe Simonis 1304d13c7f [MERGE] forward port branch 9.0 up to 25616b9 2016-10-27 17:35:49 +02:00
Christophe Simonis 477e69d850 [MERGE] forward port branch saas-6 up to 3c3ce75 2016-10-27 14:42:57 +02:00
Christophe Simonis 3c3ce750f7 [MERGE] forward port branch 8.0 up to 5ee4344 2016-10-27 14:11:46 +02:00
Simon Lejeune 097f46e09a [REF] packaging: debian: depend on python-babel
Before this patch, the debian package depends on `python-pybabel`.
According to the documentation, this is a dummy package for transition
from `python-pybabel` to `python-babel`[1].

This dummy package has thus been removed in debian stretch in favor of
`python-babel`, and the odoo package is thus not installable in debian
stretch.

To fix this, we depend directly on `python-babel`, which is available in
all debian releases[2].

Closes #13905

[1] https://packages.debian.org/jessie/python-pybabel
[2] https://packages.debian.org/jessie/python-babel
2016-10-24 16:22:17 +02:00
Christophe Simonis f9072c789d [MERGE] forward port of branch 9.0 up to bfbe2d6
# Conflicts:
#	addons/marketing/i18n/es_PE.po
#	addons/marketing/i18n/hu.po
2016-06-14 19:27:16 +02:00
Simon Lejeune 123e51f4d5 [REF] ir_qweb: less webasset: compress output instead of minifying it
* Remove dependency on less-plugin-clean-css which distribution
  packages are broken on debian stretch and derivated.
* Updated documentation.
* Lessc provides a `--compress` argument that could solve this issue.
  According to the documentation at http://lesscss.org/usage/: "[...]
  Compress using less built-in compression. This does an okay job but
  does not utilise all the tricks of dedicated css compression[...]"
  However, using this argument works on lessc 2.5.3 but not on 1.4.2
  (`--compress` arg is present but seems to be break some rules
  i haven't been able to put my finger on).
* Finally, use the minification of the StylesheetAsset that takes care
  of removing the spaces, the comments and the sourcemap with regexes.

fixes issue #9113
2016-06-10 17:22:03 +02:00
Simon Lejeune c1ff5d894c [REF] packaging: depends on XlsxWriter 2015-11-26 14:37:33 +01:00
Simon Lejeune 038949f395 [REF] packaging: debian: don't require ofxparse
because it's available in debian stable but not in ubuntu 14.04 (lts)
2015-11-10 14:43:41 +01:00
Leonardo Rochael Almeida 60af7cac02 [IMP] replace simplejson with stdlib json
The stdlib version of the json library is more recent than the 3.5.3
version we are pinning in `requirements.txt`

There is no reason to use it.

Closes #6940
2015-09-28 10:53:32 +02:00
Leonardo Rochael Almeida 06b3026bcd [IMP] unittest2 > unittest
The `unittest2` package is simply a backport of `unittest` from the
Standard Library of Python 2.7 to previous versions.

There is no reason to use it any longer.

Closes #6941
2015-09-28 10:37:27 +02:00
Simon Lejeune ea0bcfac34 [FIX] packaging: adapt test environment to less dependency 2015-09-11 18:10:56 +02:00
Simon Lejeune 9f3b26c1ca [REF] packaging: ofxparse as "hard" dependency 2015-07-31 14:11:16 +02:00
Simon Lejeune 44c83299e3 [FIX] packaging: python-suds in debian's test environment 2015-07-23 14:28:20 +02:00
Christophe Simonis 1510a81366 [MERGE] forward port of branch 8.0 up to 9ac62d7 2015-07-16 11:21:22 +02:00
Simon Lejeune 936e321ae0 [FIX] packaging: remove policy-rc configuration
It was preventing postgresql to generate a working cluster.
2015-07-14 19:13:51 +02:00
Simon Lejeune b3f7670c96 [FIX] packaging: remove policy-rc configuration
It was preventing postgresql to generate a working cluster.
2015-07-14 18:05:01 +02:00
Nicolas Martinelli c8c84d4a4e [IMP] Packaging: use docker image of debian jessie.
Update to pip v6 necessary to avoid import error of 'IncompleteRead' from requests.compat
2015-02-23 08:24:24 +01:00
Nicolas Martinelli 520360d80b [ADD] Packaging: nightly tests: src dockerfile
Creation of a Dockerfile for the src package for nightly tests.
Remove unnecessary libraries installation from the Debian Dockerfile.
2015-02-20 16:56:13 +01:00
Aaron Bohy 9c8c534c19 [FIX] Packaging: RedHat: prompt overriden in docker
RPM packages did not pass the tests because the centos prompt changed
and thus did not match the regexp anymore. We now explicitely specify
the prompt in our Dockerfiles to prevent such issues.
2015-01-20 17:39:14 +01:00
Aaron Bohy a7ab5a4109 [ADD] Packaging: Debian and CentOS Dockerfiles for nightly builds tests
This way we'll be using docker cache to spare dependencies download time.
2014-12-09 12:33:56 +01:00