OceanNetworksCanada / api-python-client

Provides easy access to ONC data in Python
https://oceannetworkscanada.github.io/api-python-client/
Apache License 2.0
10 stars 9 forks source link

Issue 1 update project setup #14

Closed kan-fu closed 9 months ago

kan-fu commented 10 months ago

Partly fix #1. DMAS-77309. I will have another PR to add CI after this PR is merged since it already contains several commits.

Suggest to review each commit separately because the commit that adds formatter can be safely ignored.

There are three steps:

  1. Replace setup.py with pyproject.toml. Minimum python version is set to match pandas (>=3.9). I have published a test pypi to display what it looks like (see old one).
  2. Add formatter. Black and isort are selected.
  3. Add linter. Ruff is selected because it is used by pandas. I have also added one docstring that relates to #9 when fixing line-too-long error.

BTW, I am following Angular Commit Style for the commit messages. It is described at here and here.

spencerwplovie commented 10 months ago

Huh, never knew commit conventions were a thing. Good to know.

kan-fu commented 10 months ago

Huh, never knew commit conventions were a thing. Good to know.

The idea first came to me when I read the py-pkgs book. Although it is mainly used together with Python Semantic Release library, which is too much for this repo, I believe adding some quick types in the commit message will definitely help when writing the release notes.

Jacob-Stevens-Haas commented 10 months ago

Huh, never knew commit conventions were a thing. Good to know.

The idea first came to me when I read the py-pkgs book. Although it is mainly used together with Python Semantic Release library, which is too much for this repo, I believe adding some quick types in the commit message will definitely help when writing the release notes.

These are neat. I had previously been using pandas commit message format, but I like the py-pkgs one.

kan-fu commented 9 months ago

Besides setting the minimum python version to 3.8, the latest commit updates some outdated text on Readme file, and move onc to src folder. Initially I did not plan to move the onc folder because [tool.setuptools] in pyproject.toml works fine. There are many libraries (like pandas and numpy) that has this non-src layout.

However I met some problems when using sphinx-autoapi extension. Using src layout magically solves the issue. Also I am persuaded by py-pkg and setuptools documentations.

Jacob-Stevens-Haas commented 9 months ago

I've had both /src/ and flat layouts before. Usually there's something in conf.py with sphinx. This is a common bikeshedding issue, so go with whatever works.

Are you looking for an additional review on this PR? This LGTM