Skip to content

Commit

Permalink
Change project structure to src/pyecotaxa (#17)
Browse files Browse the repository at this point in the history
* Move source directory
* Make versioneer build requirement
* Adjust setup.py
* Update versioneer
* Tox
* Update workflows
* Compatibility 3.9-3.12
* Fix tests
* Replace flake8 with ruff
* Make ruff happy
  • Loading branch information
moi90 authored Oct 18, 2024
1 parent 0da9530 commit 53cab3e
Show file tree
Hide file tree
Showing 15 changed files with 324 additions and 1,972 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyecotaxa/_version.py export-subst
src/pyecotaxa/_version.py export-subst
37 changes: 15 additions & 22 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,27 @@ name: Tests

on:
push:
branches: [ master ]
branches: [main]
pull_request:
branches: [ master ]
branches: [main]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[tests]
- name: Test with pytest
run: |
pytest
8 changes: 8 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Ruff
on: [ push, pull_request ]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v1
4 changes: 0 additions & 4 deletions pyecotaxa/__init__.py

This file was deleted.

12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel"] # PEP 508 specifications.
requires = ["setuptools", "wheel", "versioneer"] # PEP 508 specifications.

[tool.black]
exclude = "\\.eggs|\\.git|\\.hg|\\.mypy_cache|\\.nox|\\.tox|\\.venv|_build|buck-out|build|dist|versioneer\\.py|_version\\.py|\\.vscode"
Expand All @@ -9,4 +9,12 @@ line_length = 88
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
line_length = 88
line_length = 88

[tool.versioneer]
VCS = "git"
style = "pep440-pre"
versionfile_source = "src/pyecotaxa/_version.py"
versionfile_build = "pyecotaxa/_version.py"
tag_prefix = ""
parentdir_prefix = ""
12 changes: 0 additions & 12 deletions setup.cfg

This file was deleted.

16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
url="https://github.com/ecotaxa/pyecotaxa",
packages=find_packages(),
packages=find_packages("src"),
package_dir={"": "src"},
include_package_data=True,
install_requires=[
"pandas",
Expand All @@ -29,25 +30,26 @@
],
python_requires=">=3.6",
extras_require={
"test": [
"tests": [
# Pytest
"pytest",
"pytest-cov",
"flake8",
"ruff",
],
"docs": [
"sphinx >= 1.4",
"sphinx_rtd_theme",
"sphinx-autodoc-typehints>=1.10.0",
],
"dev": ["black"],
"dev": ["black", "versioneer"],
},
entry_points={},
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
Expand Down
3 changes: 3 additions & 0 deletions src/pyecotaxa/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import _version

__version__ = _version.get_versions()["version"]
File renamed without changes.
Loading

0 comments on commit 53cab3e

Please sign in to comment.