diff --git a/.flake8 b/.flake8
index 92deed0..3a97ced 100644
--- a/.flake8
+++ b/.flake8
@@ -1,5 +1,5 @@
[flake8]
-exclude = .git,build
+exclude = .git, __pycache__, build, dist
ignore = E203, E266, E501, W503, F403, F401, C901
max-line-length = 100
max-complexity = 18
diff --git a/.github/workflows/poetry.yml b/.github/workflows/poetry.yml
new file mode 100644
index 0000000..37e767e
--- /dev/null
+++ b/.github/workflows/poetry.yml
@@ -0,0 +1,58 @@
+# Poetry GitHub Action: https://github.com/marketplace/actions/python-poetry-action
+name: pydevtips
+
+# on: [push, pull_request]
+on:
+ # trigger on pushes and PRs to main
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ build:
+
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ max-parallel: 12
+ matrix:
+ os: [ubuntu-latest, macos-latest, windows-latest]
+ python-version: ["3.10", "3.11"]
+ poetry-version: ["1.8.4"]
+ steps:
+ - uses: actions/checkout@v4
+ - name: Checkout submodules
+ shell: bash
+ run: |
+ auth_header="$(git config --local --get http.https://github.com/.extraheader)"
+ git submodule sync --recursive
+ git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install poetry
+ uses: abatilo/actions-poetry@v3.0.0
+ with:
+ poetry-version: ${{ matrix.poetry-version }}
+ - name: Install dependencies
+ run: |
+ poetry install --with dev
+ - name: Lint with flake8
+ run: |
+ # stop the build if there are Python syntax errors or undefined names
+ poetry run flake8 pydevtips --count --select=B,C,E,F,W,T4,B9 --show-source --statistics --max-complexity=18 --max-line-length=100 --ignore=E203,E266,E501,W503,F403,F401,C901
+ poetry run flake8 examples --count --select=B,C,E,F,W,T4,B9 --show-source --statistics --max-complexity=18 --max-line-length=100 --ignore=E203,E266,E501,W503,F403,F401,C901
+ poetry run flake8 profile --count --select=B,C,E,F,W,T4,B9 --show-source --statistics --max-complexity=18 --max-line-length=100 --ignore=E203,E266,E501,W503,F403,F401,C901
+ poetry run flake8 tests --count --select=B,C,E,F,W,T4,B9 --show-source --statistics --max-complexity=18 --max-line-length=100 --ignore=E203,E266,E501,W503,F403,F401,C901
+ - name: Format with black
+ run: |
+ poetry run black pydevtips -l 100
+ poetry run black examples -l 100
+ poetry run black profile -l 100
+ poetry run black tests -l 100
+ - name: Test with pytest
+ run: poetry run pytest -v
\ No newline at end of file
diff --git a/.github/workflows/python.yml b/.github/workflows/setuptools.yml
similarity index 91%
rename from .github/workflows/python.yml
rename to .github/workflows/setuptools.yml
index ad38883..258c21a 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/setuptools.yml
@@ -1,14 +1,11 @@
-name: pydevtips
+name: pydevtips setuptools
-# on: [push, pull_request]
+# HACK to not trigger GitHub action
on:
- # trigger on pushes and PRs to main
push:
branches:
- - main
- pull_request:
- branches:
- - main
+ - non-existant-branch
+
jobs:
build:
diff --git a/.gitignore b/.gitignore
index 959bbd5..877ffd6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
project_env/
.DS_Store
+dataset/
# from hydra
outputs/
@@ -13,6 +14,7 @@ __pycache__/
*.so
# Distribution / packaging
+poetry.lock
.Python
build/
develop-eggs/
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 75c9e5a..9fe8a31 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,4 +1,11 @@
repos:
+- repo: https://github.com/python-poetry/poetry
+ rev: '1.8.4' # add version here
+ hooks:
+ - id: poetry-check
+ - id: poetry-lock
+ - id: poetry-export
+ - id: poetry-install
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
@@ -7,4 +14,9 @@ repos:
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- - id: flake8
\ No newline at end of file
+ - id: flake8
+- repo: https://github.com/pycqa/isort
+ rev: 5.13.2
+ hooks:
+ - id: isort
+ name: isort (python)
\ No newline at end of file
diff --git a/setup.py b/OLD_setup.py
similarity index 100%
rename from setup.py
rename to OLD_setup.py
diff --git a/README.rst b/README.rst
index 4009a39..23fb6fd 100644
--- a/README.rst
+++ b/README.rst
@@ -20,13 +20,13 @@ pydevtips: Python Development Tips
:alt: Slides
-.. |ss| raw:: html
+.. .. |ss| raw:: html
-
+..
-.. |se| raw:: html
+.. .. |se| raw:: html
-
+..
Reproducibility is important for software: *if it's not reproducible,
@@ -54,13 +54,13 @@ But hopefully this gives you a starting point. Feel free to pick and
choose the features that you like. This flexibility is one of the best
(and worst parts) of open source. Some of the things we cover:
+* Packaging and distribution with `Poetry `_.
* Virtual environments.
* Version control.
* Reproducible examples.
* Documentation.
* Code formatting.
* Unit tests and continuous integration.
-* Packaging and distribution.
* Remove development.
The accompanying
@@ -75,7 +75,7 @@ Feel free to modify and use it for your own purposes.
Copilot `_, which I highly recommend for development. If you don't like
writing documentation, it is a great way to get started as it is able to
understand the functionality of your code and produce meaningful text to describe it.
- It should be used be used with caution, |ss| *but it can be a great tool for getting started* |se|
+ It should be used be used with caution, *but it can be a great tool for getting started*
and you often you need to make a few tweaks (*like the previous repetition*).
But it's a huge time-saver!
@@ -93,6 +93,8 @@ Or from source, e.g. with Anaconda / Miniconda:
.. code:: bash
# create new environment, press enter to accept
+ # -- important to set python version, otherwise `python` executable may not exist
+ # -- (would be `python3` instead)
conda create -n project_env python=3.11
# view available environments
@@ -102,11 +104,10 @@ Or from source, e.g. with Anaconda / Miniconda:
conda activate project_env
# install package locally
- (project_env) pip install -e .
+ (project_env) poetry install --with dev
# run tests
- # - one time: pip install pytest
- (project_env) pytest
+ (project_env) poetry run pytest
# deactivate environment
(project_env) conda deactivate
@@ -123,19 +124,19 @@ repository, e.g.:
python examples/real_convolve.py
Parameter setting is done with `hydra `_. More on that
-in the :ref:`Reproducible examples` section of the
-documentation.
+in the `Reproducible examples `_
+section of the documentation.
TODO
====
+- switch to ruff for code formatting: https://docs.astral.sh/ruff/
- numba: https://numba.pydata.org/
- picking a license
- change documentation links to main branch
- github page
- point out features in scripts: object-oriented, asserts, tqdm, type hints
-- matplotlib, pytest, black in dev install
- manifest file to not include file in package
- GitHub actions for releasing to PyPi when changes to version
- pytorch compatible
diff --git a/docs/source/clean_code.rst b/docs/source/clean_code.rst
index 1c26825..ac2af5c 100644
--- a/docs/source/clean_code.rst
+++ b/docs/source/clean_code.rst
@@ -16,10 +16,16 @@ tools that can help us with this task. The ones we use are:
* `Black `_ which will reformat your code
in-place to conform to the PEP8 standard.
-* `Flake8 `__ which is a *linter* that
+* `Flake8 `_ which is a *linter* that
will check your code for errors and style violations, but not reformat it. For
example, for me it has identified code where I have unused variables or
scripts / functions that are too long.
+* `isort `_ which will sort your imports
+ alphabetically and group them by type.
+
+There are many alternatives for there tools. An increasingly popular alternative
+is `ruff `_, which is written in Rust and is meant
+to replace Flake8, Black, and isort.
While you can use these tools manually, it is much more convenient to use them
as pre-commit hooks. This means that before you commit your code, these tools
@@ -34,7 +40,7 @@ A few files are needed to setup pre-commit hooks:
pre-commit hooks. It specifies which tools to use, and how to use them.
* `.flake8 `_: This file contains the configuration for Flake8. It specifies
e.g. which errors to ignore, and which line length to use.
-* `pyproject.toml `_: This file contains the configuration for Black. It
+* `pyproject.toml `_: This file contains the configuration for Black and isort. It
specifies e.g. which line length to use.
You can then install the pre-commit hooks for your project by running the
@@ -43,13 +49,18 @@ following commands:
.. code:: bash
# inside virtual environment
- (project_env) pip install pre-commit
- (project_env) pip install black
+ # -- black, flake8, isort are in the dev group
+ (project_env) poetry install --with dev
+
+ # -- if not using Poetry
+ # (project_env) pip install pre-commit black flake8 isort
# Install git hooks
(project_env) pre-commit install
# pre-commit installed at .git/hooks/pre-commit
+More pre-commit hooks are available provided by `Poetry `_.
+
Avoiding long ``if-else`` statements with object instantiation
--------------------------------------------------------------
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 7e3e85c..d8d7735 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -15,9 +15,9 @@
# sys.path.insert(0, os.path.abspath('.'))
import datetime
+import os
import sys
from unittest import mock
-import os
sys.path.insert(0, os.path.abspath(os.path.join("..", "..")))
@@ -55,7 +55,7 @@
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"NumPy [latest]": ("https://docs.scipy.org/doc/numpy/", None),
- "matplotlib": ("http://matplotlib.sourceforge.net/", None),
+ "matplotlib [stable]": ("https://matplotlib.org/stable/", None),
}
intersphinx_disabled_domains = ["std"]
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 3694e87..b359950 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -15,13 +15,13 @@ Contents
.. toctree::
+ packaging
virtual_env
version_control
reproducible
documentation
clean_code
testing
- packaging
remote_development
badges
diff --git a/docs/source/packaging.rst b/docs/source/packaging.rst
index de8f112..f0fd24e 100644
--- a/docs/source/packaging.rst
+++ b/docs/source/packaging.rst
@@ -3,11 +3,31 @@ Packaging
Packaging your code is the process of organizing your project files
so that it can be built and installed by other users. As well as
-your source code, there are a few files that are needed by
-`setuptools `__ -- the
-commonly-used Python library for packaging code that can be
-installed with `pip `_ and uploaded
-to `PyPI `_.
+your source code, there are a few files that are needed so that
+your project "pip-installable", i.e. can be installed with
+`pip `_ and uploaded to
+`PyPI `_.
+
+While the `Python Packaging Authority (PyPA) `_
+provides a comprehensive `guide `_
+on packaging Python projects, this project instead uses `Poetry `_.
+Poetry is one of many tools that can be used to manage Python packages and environments.
+It simplifies/automates a lot of small aspects than if we were to use
+approach described by PyPA.
+
+`uv `_ is another popular tool for Python packaging,
+written in Rust.
+
+
+Poetry setup
+------------
+
+As a first-time setup, Poetry needs to be installed. The process is described on
+`this page `_. I recommend using the
+``pipx`` method:
+
+1. Install ``pipx``: https://pipx.pypa.io/stable/installation/
+2. Install Poetry: ``pipx install poetry``
Project structure
@@ -23,7 +43,7 @@ A typical (minimal) file structure for a Python project to be
|-- code.py
|-- # other files
README.rst # or .md, .txt, etc
- setup.py
+ pyproject.toml # or setup.cfg or setup.py
where:
@@ -33,14 +53,31 @@ where:
is often the first file that new users will look into to learn
about the project, how to install it, and how to use it. On GitHub
and PyPI, it will be rendered as the "homepage" for your project.
-* ``setup.py`` is a configuration file for installing the project. More
- on that :ref:`below `.
+* ``pyproject.toml`` is a configuration file for building the project.
+ More on that :ref:`below `. In the past, Python projects
+ used ``setup.py`` for this purpose, but ``pyproject.toml`` is becoming
+ more and more the norm. As this project used to use ``setup.py``,
+ more on that can be found :ref:`below `.
+
+
+Project Management and Packaging with Poetry
+---------------------------------------------
+
+`This page `_ provides an
+overview of how to use Poetry:
+
+* For a `new project `_,
+ you can run ``poetry new poetry-demo``. This will create a new folder with
+ the project structure described above, including an empty ``tests`` folder.
+* For an `existing project `_,
+ you can run ``poetry init``. Through the command line, you will be asked
+ a series of questions to fill in the ``pyproject.toml`` file.
The project can then be built (locally) with the command below:
.. code:: bash
- (project_env) pip install -e .
+ (project_env) poetry install
The project can be imported in your Python script as:
@@ -48,14 +85,107 @@ The project can be imported in your Python script as:
import project
+.. note::
+ One useful feature of Poetry is that with a **single command** you can
+ install new dependencies and update the ``pyproject.toml`` file.
+ For example, to install ``pandas`` and add to ``pyproject.toml``,
+ you can run:
+
+ .. code:: bash
+
+ (project_env) poetry add pandas
+
+ You can also create groups of dependencies, e.g. for development
+ dependencies, by running:
+
+ .. code:: bash
+
+ (project_env) poetry add --group dev sphinx
+
+ So that during installation, you can specify which group of
+ dependencies:
+
+ .. code:: bash
-setup.py
---------
+ (project_env) poetry install --with dev
+
+ More on managing dependencies can be found `here `_.
+
+
+pyproject.toml
+--------------
+
+Using a ``pyproject.toml`` file is not unique to Poetry, but is becoming
+more and more the norm for Python projects. Below is the ``pyproject.toml``
+file for this project.
+
+.. literalinclude:: ../../pyproject.toml
+ :caption: pyproject.toml
+ :linenos:
+
+Everything except the sections labeled with "manually added" was
+automatically generated by Poetry.
+
+More info on configuring the ``pyproject.toml`` file can be found at the links below:
+
+* General configuration (`short `_
+ and `in-depth `_ guides).
+* Poetry configuration: https://python-poetry.org/docs/pyproject/
+
+
+Publishing to PyPI with Poetry
+------------------------------
+
+Poetry also makes building and deploying to PyPI easy.
+`This article `_
+sums up the process well:
+
+1. (First-time) setup:
+
+ * Create an account on PyPI: https://pypi.org/account/register/
+ * Create a token: https://pypi.org/manage/account/
+ * Add the token to Poetry: ``poetry config pypi-token.pypi ``
+2. Update the version number in the ``pyproject.toml`` file. See `Semantic Versioning `__ for recommendations on picking version numbers.
+3. Build the package: ``poetry build``
+4. Upload to PyPI: ``poetry publish``. Check https://pypi.org/project/pydevtips/ 🎉
+
+If there are issues in publishing to PyPI, you can check the logs with:
+
+.. code:: bash
-The ``setup.py`` is used to configure the project packaging by ``setuptools``.
-Below is the ``setup.py`` file for this "dummy" project.
+ poetry publish --dry-run
-.. literalinclude:: ../../setup.py
+Or if there are issues with rendering the README file, you can check the logs with (``twine`` is required):
+
+.. code:: bash
+
+ twine check dist/pydevtips-X.X.X.tar.gz # replace X.X.X with version number
+
+
+Creating a new release on GitHub
+--------------------------------
+
+For a new release, you should create a new tag on GitHub. This can be done with the command below:
+
+.. code:: bash
+
+ git tag -a X.X.X -m "version X.X.X"
+ git push origin X.X.X
+
+If you project is hosted on GitHub, you can create a new release by:
+
+#. Clicking (the rightmost) "..." dropdown menu (from the `tags page `_).
+#. Selecting "Create release".
+#. At the bottom pressing "Publish release".
+
+
+setup.py (old way)
+------------------
+
+The use of ``setup.py`` is an older way to Python projects, e.g, with ``setuptools``.
+Below is a previously-used ``setup.py`` file for this project.
+
+.. literalinclude:: ../../OLD_setup.py
:caption: setup.py
:linenos:
@@ -70,12 +200,21 @@ Below is the ``setup.py`` file for this "dummy" project.
* Line 9-10: for your name and contact info.
* Line 20-26: specifies the Python version and package dependencies.
-For a more in-depth description, check out `this article `_.
+The project can then be built (locally) with the command below:
+
+.. code:: bash
-Releasing new version and deploying to PyPI
--------------------------------------------
+ (project_env) pip install -e .
+
+The project can be imported in your Python script as:
+
+.. code:: Python
+
+ import project
+
+For a more in-depth description, check out `this article `_.
-Uploading your project to PyPI is done via the `twine `__
+Uploading your project to PyPI is traditionally done with the `twine `__
library.
.. code:: bash
diff --git a/docs/source/testing.rst b/docs/source/testing.rst
index 556230b..79b5de5 100644
--- a/docs/source/testing.rst
+++ b/docs/source/testing.rst
@@ -57,17 +57,25 @@ To run the unit tests:
.. code:: bash
# install in virtual environment (if not done already)
- (project_env) pip install pytest
+ # -- pytest in the dev group
+ (project_env) poetry install --with dev
# run tests
- (project_env) pytest
+ (project_env) poetry run pytest
+
+ # -- if not using Poetry
+ # (project_env) pip install pytest
+ # (project_env) pytest
To run a specific test:
.. code:: bash
# inside virtual environment
- (project_env) pytest tests/test_fftconvolve.py::test_fft
+ (project_env) poetry run pytest tests/test_fftconvolve.py::test_fft
+
+ # -- if not using Poetry
+ # (project_env) pytest tests/test_fftconvolve.py::test_fft
Continuous integration with GitHub Actions
@@ -82,15 +90,28 @@ the repository. This workflow can build the package, run the unit tests, build t
documentions, etc for different versions of Python and operating systems.
Workflows are defined in YAML files in the ``.github/workflows`` folder. For example,
-the workflow for this project is defined in `this file `__.
+the workflow for this project is defined in `this file `__,
+whose code is shown below:
+
+.. literalinclude:: ../../.github/workflows/poetry.yml
+ :caption: poetry.yml
+ :linenos:
+
The workflow performs the following:
-* Triggers on pushes and pull requests to the ``main`` branch (`code link `__).
-* Performs the test on all combinations of Python 3.8, 3.9, and 3.10 and operating systems
- Ubuntu, Windows, and macOS (`code link `__).
-* Installs the package and its dependencies (`code link `__).
-* Checks for code formatting and style and errors if it doesn't conform (`code link `__).
+* (Lines 5-12) Triggers on pushes and pull requests to the ``main`` branch.
+* (Lines 21-24) Performs the test on all combinations of Python versions (3.10 and 3.11) and operating systems
+ Ubuntu, Windows, and macOS.
+* (Lines 33-43) Installs Python, Poetry, and the package with its dependencies.
+* (Lines 44-56) Checks for code formatting and style and errors if it doesn't conform.
*Make sure it matches the code formatting you've setup in your project, e.g. via* :ref:`pre-commit hooks `.
-* Runs the unit tests (`code link `__).
+* (Lines 57-58) Runs the unit tests.
+
+An older version of the workflow (not using Poetry but rather ``setup.py`` with
+``setuptools``) can be found below:
+
+.. literalinclude:: ../../.github/workflows/setuptools.yml
+ :caption: setuptools.yml (OLD WAY)
+ :linenos:
More information on configuring GitHub Actions can be found in `their documentation `__.
diff --git a/docs/source/version_control.rst b/docs/source/version_control.rst
index 3db33e0..dad1305 100644
--- a/docs/source/version_control.rst
+++ b/docs/source/version_control.rst
@@ -13,4 +13,4 @@ which can also help in the reproducibility of your code by allowing others to
conveniently access your code. Example platforms for Git are GitHub, GitLab,
and Bitbucket. GitHub is the most popular, and is used for this project.
-More on Git and GitHub can be found in this `interactive tutorial `_.
+More on Git and GitHub can be found in this `tutorial `_.
diff --git a/docs/source/virtual_env.rst b/docs/source/virtual_env.rst
index 6f6db3b..4818b84 100644
--- a/docs/source/virtual_env.rst
+++ b/docs/source/virtual_env.rst
@@ -9,8 +9,8 @@ Creating an environment
-----------------------
There are several ways to create virtual environments. The most popular
-(and recommended) is with `Anaconda `__.
-After installing Anaconda or `Miniconda `__ (light version),
+(and recommended) is with `Anaconda `_.
+After installing Anaconda or `Miniconda `_ (light version),
you create a new environment like so:
.. code:: bash
@@ -29,7 +29,7 @@ you create a new environment like so:
For machines really light on memory (e.g. Raspberry Pi), you can use
-`Virtualenv `__:
+`Virtualenv `_:
.. code:: bash
@@ -48,6 +48,17 @@ For machines really light on memory (e.g. Raspberry Pi), you can use
Note that when the virtual environment is activated, it will
typically appear in parenthesis in the command line.
+In this project we recommend using Poetry, and while Poetry creates a virtual
+environment per project (as described `here `_),
+I typically stick to using one of the above methods for creating virtual environments
+(e.g. to use conda, to share environments with other projects, to use in notebooks).
+You can identify the location and info of the Poetry virtual environment by running:
+
+.. code:: bash
+
+ poetry env info
+
+
Sharing your environment
------------------------
@@ -94,16 +105,3 @@ storing and keeping track of packages:
Note that this approach is specific to Anaconda / Miniconda. More
information can be found
`here `_.
-
-
-* A more involved approach to package your project, such that it can be installed via ``pip`` with the necessary dependencies:
-
- .. code:: bash
-
- # local install
- (project_env) pip install -e .
-
- # if on PyPi
- (project_env) pip install
-
- This approach is discussed in PACKAGING.
diff --git a/environment.yml b/environment.yml
index 83095d2..9e4fc72 100644
--- a/environment.yml
+++ b/environment.yml
@@ -1,23 +1,121 @@
name: project_env
channels:
-- conda-forge
-- defaults
+ - defaults
dependencies:
-- bzip2=1.0.8=h0d85af4_4
-- ca-certificates=2022.9.24=h033912b_0
-- libffi=3.4.2=h0d85af4_5
-- libsqlite=3.40.0=ha978bb4_0
-- libzlib=1.2.13=hfd90126_4
-- ncurses=6.3=h96cf925_1
-- openssl=3.0.7=hfd90126_0
-- pip=22.3.1=pyhd8ed1ab_0
-- python=3.9.13=hf8d34f4_0_cpython
-- readline=8.1.2=h3899abd_0
-- setuptools=65.5.1=pyhd8ed1ab_0
-- sqlite=3.40.0=h9ae0607_0
-- tk=8.6.12=h5dbffcc_0
-- tzdata=2022f=h191b570_0
-- wheel=0.38.4=pyhd8ed1ab_0
-- xz=5.2.6=h775f41a_0
+ - bzip2=1.0.8=h80987f9_5
+ - ca-certificates=2023.12.12=hca03da5_0
+ - libffi=3.4.4=hca03da5_0
+ - ncurses=6.4=h313beb8_0
+ - openssl=3.0.13=h1a28f6b_0
+ - pip=23.3.1=py311hca03da5_0
+ - python=3.11.8=hb885b13_0
+ - readline=8.2=h1a28f6b_0
+ - setuptools=68.2.2=py311hca03da5_0
+ - sqlite=3.41.2=h80987f9_0
+ - tk=8.6.12=hb8d0fd4_0
+ - wheel=0.41.2=py311hca03da5_0
+ - xz=5.4.6=h80987f9_0
+ - zlib=1.2.13=h5a0b063_0
+ - pip:
+ - aiohappyeyeballs==2.3.7
+ - aiohttp==3.10.3
+ - aiosignal==1.3.1
+ - antlr4-python3-runtime==4.9.3
+ - attrs==24.2.0
+ - audioread==3.0.1
+ - backports-tarfile==1.2.0
+ - black==24.10.0
+ - certifi==2024.8.30
+ - cffi==1.17.0
+ - cfgv==3.4.0
+ - charset-normalizer==3.4.0
+ - click==8.1.7
+ - contourpy==1.3.0
+ - cycler==0.12.1
+ - datasets==2.21.0
+ - decorator==5.1.1
+ - dill==0.3.8
+ - distlib==0.3.9
+ - docutils==0.21.2
+ - filelock==3.16.1
+ - flake8==7.1.1
+ - fonttools==4.54.1
+ - frozenlist==1.4.1
+ - fsspec==2024.6.1
+ - huggingface-hub==0.24.5
+ - hydra-core==1.3.2
+ - identify==2.6.1
+ - idna==3.10
+ - importlib-metadata==8.5.0
+ - iniconfig==2.0.0
+ - isort==5.13.2
+ - jaraco-classes==3.4.0
+ - jaraco-context==6.0.1
+ - jaraco-functools==4.1.0
+ - jedi==0.19.1
+ - joblib==1.4.2
+ - keyring==25.4.1
+ - kiwisolver==1.4.7
+ - lazy-loader==0.4
+ - librosa==0.10.2.post1
+ - llvmlite==0.43.0
+ - markdown-it-py==3.0.0
+ - matplotlib==3.9.2
+ - mccabe==0.7.0
+ - mdurl==0.1.2
+ - more-itertools==10.5.0
+ - msgpack==1.0.8
+ - multidict==6.0.5
+ - multiprocess==0.70.16
+ - mypy-extensions==1.0.0
+ - nh3==0.2.18
+ - nodeenv==1.9.1
+ - numba==0.60.0
+ - numpy==2.1.2
+ - omegaconf==2.3.0
+ - packaging==24.1
+ - pandas==2.2.2
+ - parso==0.8.4
+ - pathspec==0.12.1
+ - pillow==11.0.0
+ - pkginfo==1.10.0
+ - platformdirs==4.3.6
+ - pluggy==1.5.0
+ - pooch==1.8.2
+ - pre-commit==4.0.1
+ - pudb==2024.1.2
+ - pyarrow==17.0.0
+ - pycodestyle==2.12.1
+ - pycparser==2.22
+ - pydevtips==0.0.3
+ - pyflakes==3.2.0
+ - pygments==2.18.0
+ - pyparsing==3.2.0
+ - pytest==8.3.3
+ - python-dateutil==2.9.0.post0
+ - pytz==2024.1
+ - pyyaml==6.0.2
+ - readme-renderer==44.0
+ - requests==2.32.3
+ - requests-toolbelt==1.0.0
+ - rfc3986==2.0.0
+ - rich==13.9.2
+ - scikit-learn==1.5.1
+ - scipy==1.14.1
+ - six==1.16.0
+ - soundfile==0.12.1
+ - soxr==0.4.0
+ - threadpoolctl==3.5.0
+ - tqdm==4.66.5
+ - twine==5.1.1
+ - typing-extensions==4.12.2
+ - tzdata==2024.1
+ - urllib3==2.2.3
+ - urwid==2.6.15
+ - urwid-readline==0.14
+ - virtualenv==20.27.0
+ - wcwidth==0.2.13
+ - xxhash==3.5.0
+ - yarl==1.9.4
+ - zipp==3.20.2
prefix: /Users/eric/anaconda3/envs/project_env
-
diff --git a/examples/joblib_parallel.py b/examples/joblib_parallel.py
index 2f53bd2..116b04c 100644
--- a/examples/joblib_parallel.py
+++ b/examples/joblib_parallel.py
@@ -5,7 +5,6 @@
"""
-
import numpy as np
import time
diff --git a/pydevtips/fftconvolve.py b/pydevtips/fftconvolve.py
index 7789c78..1a622aa 100644
--- a/pydevtips/fftconvolve.py
+++ b/pydevtips/fftconvolve.py
@@ -1,6 +1,7 @@
-import numpy as np
from abc import abstractmethod
+import numpy as np
+
class FFTConvolveBase:
"""Abstract class for FFT convolve."""
diff --git a/pyproject.toml b/pyproject.toml
index da68dd9..af7e4cd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,60 @@
+[tool.poetry]
+name = "pydevtips"
+version = "0.0.3"
+description = "Functions and scripts to demonstrate Python development tips."
+authors = ["Eric Bezzam "]
+license = "MIT"
+
+# -- manually added --
+readme = "README.rst"
+package-mode = true # https://python-poetry.org/docs/basic-usage/#operating-modes
+# --------------------
+
+[tool.poetry.dependencies]
+python = "^3.10"
+numpy = "^2.1.2"
+scipy = "^1.14.1"
+matplotlib = "^3.9.2"
+hydra-core = "^1.3.2"
+tqdm = "^4.66.5"
+
+
+[tool.poetry.group.dev.dependencies]
+black = "^24.10.0"
+isort = "^5.13.2"
+flake8 = "^7.1.1"
+pytest = "^8.3.3"
+pre-commit = "^4.0.1"
+twine = "^5.1.1"
+
+[build-system]
+requires = ["poetry-core"]
+build-backend = "poetry.core.masonry.api"
+
+#### -- manually added (below)
+
+[project]
+name = "pydevtips"
+version = "0.0.3"
+authors = [
+ { name="Eric Bezzam", email="ebezzam@gmail.com" },
+]
+description = "Functions and scripts to demonstrate Python development tips."
+readme = "README.rst"
+classifiers = [
+ "Programming Language :: Python :: 3",
+ "License :: OSI Approved :: MIT License",
+ "Operating System :: OS Independent",
+]
+
+[project.urls]
+Homepage = "https://github.com/ebezzam/python-dev-tips"
+Issues = "https://github.com/ebezzam/python-dev-tips/issues"
+Documentation = "https://pydevtips.readthedocs.io"
+
+[tool.isort]
+profile = "black"
+
[tool.black]
line-length = 100
include = '\.pyi?$'
@@ -7,4 +64,4 @@ exclude = '''
| build
| dist
)/
-'''
\ No newline at end of file
+'''