Skip to content

Commit 6f60d2e

Browse files
authored
Moved requirments and setup to pyproject and simplified requirments (#163)
* Cleaned up requirments. Seeing how CICD handles it. * Got sick of travis. Trying out github actions * Opened it up so it CICD will actually run * Added back utils * Trying gitlab * Moved setup to pyproject.toml * fixed regex * Added travis back in :( * Added mysqlclient to dependencies * Added mysqlclient to dependencies * updated versions * Cleaned up requirments. Seeing how CICD handles it. * Got sick of travis. Trying out github actions * Opened it up so it CICD will actually run * Added back utils * Moved setup to pyproject.toml * fixed regex * Added travis back in :( * Added mysqlclient to dependencies * Added mysqlclient to dependencies * updated versions
1 parent ac6147c commit 6f60d2e

File tree

10 files changed

+117
-321
lines changed

10 files changed

+117
-321
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-20.04 # Equivalent to Travis 'focal'
10+
11+
strategy:
12+
matrix:
13+
python-version: [ "3.10", "3.11" ]
14+
15+
services:
16+
mysql:
17+
image: mysql:8.0
18+
env:
19+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
20+
MYSQL_DATABASE: test_db
21+
ports:
22+
- 3306:3306
23+
options: >-
24+
--health-cmd="mysqladmin ping"
25+
--health-interval=10s
26+
--health-timeout=5s
27+
--health-retries=3
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
- name: Cache pip dependencies
39+
uses: actions/cache@v3
40+
with:
41+
path: ~/.cache/pip
42+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
43+
restore-keys: |
44+
${{ runner.os }}-pip-
45+
46+
- name: Configure MySQL
47+
run: |
48+
# Enable local_infile (equivalent to Travis before_script)
49+
mysql -h127.0.0.1 -P3306 -uroot -e "SET GLOBAL local_infile=1;"
50+
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
# Install with test dependencies using new pyproject.toml structure
55+
pip install .[test]
56+
57+
- name: Run tests
58+
run: |
59+
echo "DB_HOST $METADATA_URI $TAXONOMY_URI"
60+
coverage run -m pytest -c pyproject.toml --server mysql://[email protected]:3306
61+
62+
- name: Upload coverage reports
63+
uses: codecov/codecov-action@v3
64+
with:
65+
fail_ci_if_error: false

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ test:
3232
coverage_format: cobertura
3333
path: coverage.xml
3434
expire_in: 1 week
35+

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ before_script:
1010
# In MySQL 8, local_infile is disabled by default for security reasons.
1111
# By adding SET GLOBAL local_infile=1;, we enable this feature at runtime.
1212
- mysql -e "SET GLOBAL local_infile=1;"
13-
- pip install -r requirements-test.txt
1413
- pip install .
14+
- pip install .[test]
1515
script:
1616
- echo "DB_HOST $METADATA_URI $TAXONOMY_URI"
17-
- coverage run -m pytest -c pyproject.toml --server mysql://[email protected]:3306
17+
- coverage run -m pytest -c pyproject.toml --server mysql://[email protected]:3306

pyproject.toml

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,26 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212

13+
[build-system]
14+
build-backend = "setuptools.build_meta"
15+
requires = [
16+
"setuptools",
17+
"wheel",
18+
]
19+
1320
[project]
1421
name = "ensembl-metadata-api"
15-
description = "# Ensembl Metadata API / GRPC API, SQLAlchemy ORM for the Ensembl Metadata database."
22+
description = "Ensembl Metadata API"
1623
requires-python = ">= 3.10"
17-
version="3.0.0"
18-
readme = "README.md"
24+
version = "3.0.0"
25+
dynamic = ["readme"]
1926
authors = [
20-
{name = "Ensembl", email = "[email protected]"},
27+
{ name = "Alisha Aneja", email = "[email protected]" },
28+
{ name = "Bilal El Houdaigui", email = "[email protected]" },
29+
{ name = "Daniel Poppleton", email = "[email protected]" },
30+
{ name = "Marc Chakiachvili", email = "[email protected]" },
31+
{ name = "Sanjay Boddu", email = "[email protected]" },
32+
{ name = "Vinay Kaikala", email = "[email protected]" },
2133
]
2234
license = {text = "Apache License 2.0"}
2335
keywords = [
@@ -29,42 +41,59 @@ keywords = [
2941
"grpc"
3042
]
3143
classifiers = [
32-
"Development Status :: 5 - Production/Stable",
33-
"Environment :: Console",
34-
"Intended Audience :: Developers",
44+
"Intended Audience :: Science/Research",
3545
"License :: OSI Approved :: Apache Software License",
36-
"Operating System :: POSIX",
37-
"Operating System :: Unix",
46+
"Natural Language :: English",
3847
"Programming Language :: Python",
3948
"Programming Language :: Python :: 3",
4049
"Programming Language :: Python :: 3 :: Only",
4150
"Programming Language :: Python :: 3.10",
42-
"Programming Language :: Python :: 3.11",
43-
"Topic :: Utilities",
44-
"Topic :: System :: Distributed Computing",
51+
]
52+
dependencies = [
53+
"ensembl-utils >= 0.8.0",
54+
"ensembl-py >= 3.0.0",
55+
"grpcio",
56+
"protobuf",
57+
"grpcio-tools",
58+
"grpcio-reflection",
59+
"sqlalchemy >= 2.0",
60+
"duckdb >= 1.2.0",
61+
"duckdb-engine >= 0.17.0",
62+
"pymysql",
63+
"mysqlclient",
4564
]
4665

4766
[project.urls]
4867
Homepage = "https://www.ensembl.org"
4968
Repository = "https://github.com/Ensembl/ensembl-metadata-api"
69+
"Download" = "https://github.com/Ensembl/ensembl-metadata-api"
5070
Issues = "https://github.com/Ensembl/ensembl-metadata-api/issues"
5171

72+
[project.optional-dependencies]
73+
test = [
74+
"pylint",
75+
"mypy",
76+
"coverage[toml]",
77+
"pytest-grpc",
78+
"yagrc == 1.1.2",
79+
]
80+
dev = [
81+
"ensembl-metadata-api[test]", # Include test dependencies
82+
"black",
83+
]
84+
5285
[project.scripts]
5386
ensembl-release = "scripts.release:main"
5487

5588
[tool.setuptools]
5689
package-dir = {"" = "src"}
90+
include-package-data = true
5791

5892
[tool.setuptools.packages.find]
5993
where = ["src"]
6094

61-
[build-system]
62-
build-backend = "setuptools.build_meta"
63-
requires = [
64-
"setuptools",
65-
"setuptools-scm",
66-
"wheel",
67-
]
95+
[tool.setuptools.dynamic]
96+
readme = { file = ["README.md"] }
6897

6998
[tool.black]
7099
line-length = 110
@@ -82,6 +111,7 @@ disable = [
82111
"unspecified-encoding",
83112
"wildcard-import",
84113
]
114+
85115
[tool.mypy]
86116
mypy_path = "src/ensembl"
87117
explicit_package_bases = true
@@ -98,7 +128,6 @@ addopts = [
98128
]
99129
norecursedirs = ["docs", "*.egg_info"]
100130

101-
102131
[tool.coverage.report]
103132
exclude_also = [
104133
# Do not complain about missing debug-only code

requirements-dev.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

requirements-test.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

requirements.in

Lines changed: 0 additions & 12 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 75 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)