Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move to poetry #29

Merged
merged 7 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python -
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
poetry install
- name: Install tox
run: |
poetry run pip install tox
- name: Test with tox
run: tox
run: poetry run tox
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ ci:

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.1.1
hooks:
- id: black
language_version: python3.9

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
# args: ["--profile", "black", "--filter-files"]
Expand All @@ -27,20 +27,20 @@ repos:
language_version: python3.9

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
language_version: python3.9

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.0
rev: v1.8.0
hooks:
- id: mypy
exclude: ^tests/
args: [--disallow-untyped-defs, --disallow-untyped-calls, --check-untyped-defs]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Basic Guidelines
Local Dev Environment
---------------------

To start, create a `virtual environment <https://virtualenv.pypa.io/>`_ and activate it.
If you don't already have a preferred way of doing this, you can take a look at some commonly used tools: `pew <https://github.com/berdario/pew>`_, `virtualfish <https://virtualfish.readthedocs.io/>`_, and `virtualenvwrapper <https://virtualenvwrapper.readthedocs.io/>`_.
To start, install `Poetry <https://python-poetry.org/docs/#installation>`_. Poetry will handle the creation of the virtual environment and the installation of the dependencies for you.

Next, get an up to date checkout of the ``mwsql`` repository via ``SSH``:

Expand All @@ -37,20 +36,21 @@ or if you want to use git via ``https``:

$ git clone https://github.com/blancadesal/mwsql.git

Change into the newly created directory and install an editable version of ``mwsql``:
Change into the newly created directory and install the dependencies using Poetry:

.. code-block:: bash

$ cd mwsql
$ pip install -e .
$ poetry install

pip will install all the necessary dependencies for you, no need to install from a separate ``requirements.txt`` file.
Poetry will install all the necessary dependencies for you, no need to install from a separate ``requirements.txt`` file.

Dev dependencies
----------------

The only dependency you *really* need to install is tox_. It will handle everyhing else for you,
including running tests, formatting and linting through pre-commit, and building and serving the latest version of the documentation. Below are a few examples of how to run tox:
The only dependency you *really* need to install is tox_.
It will handle everything else for you, including running tests, formatting and linting through pre-commit, and building and serving the latest version of the documentation.
Below are a few examples of how to run tox:

.. code-block:: bash

Expand Down
Loading