ncbi-acc-download 项目教程
1. 项目的目录结构及介绍
ncbi-acc-download 项目的目录结构如下:
ncbi-acc-download/
├── github/workflows/
│ ├── ncbi_acc_download.yml
│ └── tests.yml
├── coveragerc
├── gitignore
├── LICENSE
├── Makefile
├── README.md
├── publish.sh
├── pyproject.toml
├── requirements.txt
├── setup.cfg
└── setup.py
目录结构介绍
github/workflows/
: 包含 GitHub Actions 的工作流配置文件。ncbi_acc_download.yml
: 用于自动化构建和测试的配置文件。tests.yml
: 用于测试的工作流配置文件。
coveragerc
: 代码覆盖率配置文件。gitignore
: Git 忽略文件配置。LICENSE
: 项目许可证文件。Makefile
: 用于自动化任务的 Makefile。README.md
: 项目说明文档。publish.sh
: 用于发布项目的脚本。pyproject.toml
: 项目配置文件,包含构建系统的要求。requirements.txt
: 项目依赖文件。setup.cfg
: 安装配置文件。setup.py
: 安装脚本。
2. 项目的启动文件介绍
ncbi-acc-download 项目的启动文件是 setup.py
。这个文件用于安装和管理项目的依赖,并提供了项目的基本信息和配置。
setup.py
文件介绍
from setuptools import setup, find_packages
setup(
name='ncbi-acc-download',
version='0.2.8',
packages=find_packages(),
install_requires=[
'requests',
],
entry_points={
'console_scripts': [
'ncbi-acc-download=ncbi_acc_download:main',
],
},
author='Kai Blin',
author_email='kblin@biosustain.dtu.dk',
description='Download files from NCBI Entrez by accession',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
license='Apache Software License',
url='https://github.com/kblin/ncbi-acc-download',
classifiers=[
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'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',
],
)
启动文件功能
- 定义项目名称、版本和包。
- 指定项目依赖。
- 配置命令行脚本入口。
- 提供作者信息、描述、许可证和项目链接。
3. 项目的配置文件介绍
ncbi-acc-download 项目的主要配置文件是 pyproject.toml
和 setup.cfg
。
pyproject.toml
文件介绍
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "ncbi-acc-download"
version = "0.2.8"
description = "Download files from NCBI Entrez by accession"
authors = [
{ name="Kai Blin", email="kblin@biosustain.dtu.dk" }
]
license = { file="LICENSE" }
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"requests"
]
[tool.setuptools]
package-dir = { "" = "src" }
[tool.setuptools.packages.find]
where = ["src"]
setup.cfg
文件介绍
[metadata]
name = ncbi-acc-download
version = 0.2.8
description = Download files from NCBI Entrez by accession
long_description = file: README.md
long_description_