-
Notifications
You must be signed in to change notification settings - Fork 10
Update project setup #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update project setup #126
Changes from all commits
d864365
1fc6a52
c42eea9
42f3454
877297d
d5aeac6
831c6fe
a4744ce
b2cbd18
62fe488
d405a1d
f3f0eeb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -13,18 +13,17 @@ | |||||
| # serve to show the default. | ||||||
|
|
||||||
| import sys | ||||||
| import glob | ||||||
| import subprocess | ||||||
| import os | ||||||
|
|
||||||
| import tomllib | ||||||
|
|
||||||
| # If extensions (or modules to document with autodoc) are in another directory, | ||||||
| # add these directories to sys.path here. If the directory is relative to the | ||||||
| # documentation root, use os.path.abspath to make it absolute, like shown here. | ||||||
| #sys.path.insert(0, os.path.abspath('.')) | ||||||
| sys.path.insert(0, os.path.abspath('../src')) | ||||||
| sys.path.insert(0, os.path.abspath('../../python-odml/')) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know if this is needed? Seems like a hack of some sort....? |
||||||
| sys.path.insert(0, os.path.abspath('../odmltables')) | ||||||
| sys.path.insert(0, os.path.abspath('../src/odmltables')) | ||||||
| sys.path.insert(0, os.path.abspath('..')) | ||||||
|
|
||||||
| # installing current odMLtables version | ||||||
|
|
@@ -33,25 +32,25 @@ | |||||
| output, error = process.communicate() | ||||||
|
|
||||||
| import odmltables | ||||||
|
|
||||||
| VERSION = odmltables.VERSION | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe:
Suggested change
|
||||||
|
|
||||||
| # reformatting requirements files to be automatically included in docu | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still something necessary, putting deps into the documentation? |
||||||
| requirement_files = glob.glob('../requirements*.txt') | ||||||
| for requirement_file in requirement_files: | ||||||
| with open(requirement_file, 'r') as f: | ||||||
| lines = f.readlines() | ||||||
| # listify and increase readability | ||||||
| for line_id in range(len(lines)): | ||||||
| lines[line_id] = '* ' + lines[line_id] | ||||||
| lines[line_id] = lines[line_id].replace(';', ' in case of ') | ||||||
| new_filename = f'{os.path.splitext(os.path.basename(requirement_file))[0]}.rst' | ||||||
| with open(new_filename, 'w+') as f: | ||||||
| f.writelines(lines) | ||||||
|
|
||||||
|
|
||||||
| with open("../pyproject.toml", "rb") as f: | ||||||
| data = tomllib.load(f) | ||||||
|
|
||||||
| def format_dependencies(dependency_list): | ||||||
| # format a list of dependencies into a block text list | ||||||
| formatted_dependencies = '\n* '.join(dependency_list).replace(';', ' in case of ') | ||||||
| return formatted_dependencies | ||||||
|
|
||||||
| dependencies = data["project"]["dependencies"] | ||||||
| with open('requirements.rst', 'w+') as f: | ||||||
| f.write(format_dependencies(dependencies)) | ||||||
|
|
||||||
| for option, optional_dependencies in data["project"]["optional-dependencies"].items(): | ||||||
| with open(f'requirements_{option}.rst', 'w+') as f: | ||||||
| f.write(format_dependencies(optional_dependencies)) | ||||||
|
|
||||||
|
|
||||||
| # -- General configuration ------------------------------------------------ | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,14 @@ | ||
| name: odmltables | ||
| channels: | ||
| - conda-forge | ||
| - free | ||
| - anaconda | ||
| dependencies: | ||
| - python=3.7 | ||
| - setuptools | ||
| - snowballstemmer | ||
| - sphinx | ||
| - sphinx_rtd_theme | ||
| - pip | ||
| - pip: | ||
| - odml | ||
| - sphinx-rtd-theme | ||
| - python==3.11 | ||
| - setuptools | ||
| - snowballstemmer | ||
| - sphinx | ||
| - sphinx_rtd_theme | ||
| - pip | ||
| - pip: | ||
| - odml |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| import datetime | ||
|
|
||
| import odml | ||
| from odml import DType | ||
| import odmltables.odml_xls_table as odml_xls_table | ||
|
|
||
|
|
||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| [project] | ||
| name = "odmltables" | ||
| version = "1.0.1dev" | ||
| authors = [ | ||
| {name = "odMLtables authors and contributors"}, | ||
| {email = "[email protected]"} | ||
| ] | ||
| description = "An interface to convert odML structues to and from table-like representations, such as spreadsheets" | ||
| readme = "README.rst" | ||
| requires-python = ">=3.6" | ||
| license = {text = "BSD 3-Clause License"} | ||
| keywords = ["odml", "excel", "metadata management"] | ||
| classifiers = [ | ||
| "Development Status :: 5 - Production/Stable", | ||
| "Programming Language :: Python :: 3", | ||
| "Operating System :: OS Independent", | ||
| "Intended Audience :: Science/Research", | ||
| "Natural Language :: English", | ||
| "Topic :: Scientific/Engineering", | ||
| "License :: OSI Approved :: BSD License", | ||
| "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 :: Only", | ||
| ] | ||
|
|
||
| dependencies = [ | ||
| "xlrd >= 0.9.4", | ||
| "xlwt >= 1.0.0", | ||
| "numpy >= 1.8.2", | ||
| "quantities >= 0.10.1", | ||
| "odml >= 1.4.2", | ||
| "future >= 0.16.0", | ||
| "argparse >= 1.0.0", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| documentation = "http://odmltables.readthedocs.io/" | ||
| repository = "https://github.com/INM-6/python-odmltables" | ||
| download = "http://pypi.python.org/pypi/odmltables" | ||
|
|
||
|
|
||
| [build-system] | ||
| requires = ["setuptools>=62.0"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [tool.setuptools] | ||
| include-package-data = true | ||
|
|
||
| [tool.setuptools.package-data] | ||
| odmltables = ["gui/graphics/*", "logo/*"] | ||
|
|
||
| [tool.pytest.ini_options] | ||
| minversion = "7.0" | ||
| addopts = "-ra -q" | ||
| testpaths = [ | ||
| "tests", | ||
| ] | ||
| pythonpath = [ | ||
| "src" | ||
| ] | ||
|
|
||
| [project.gui-scripts] | ||
| odmltables = "odmltables.gui.main:parse_args" | ||
|
|
||
| [project.optional-dependencies] | ||
|
|
||
| doc = [ | ||
| "numpydoc>=0.5.0", | ||
| "sphinx>=1.2.2", | ||
| ] | ||
|
|
||
| gui = ["PyQt5>=5.0.0"] | ||
|
|
||
| test = ["pytest>=3.0.0"] |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| import os.path | ||
|
|
||
| with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'VERSION.txt')) as version_file: | ||
| VERSION = version_file.read().strip() | ||
|
|
||
| import importlib.metadata | ||
| # this need to be at the begining because some sub module will need the version | ||
| __version__ = importlib.metadata.version("odmltables") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this actually also work for non-installed packages? |
||
| VERSION = __version__ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems |
||
|
|
||
| # -*- coding: utf-8 -*- | ||
| """ | ||
|
|
@@ -15,9 +14,4 @@ | |
| .. autoclass:: odmltables.compare_section_csv_table.CompareSectionCsvTable | ||
| """ | ||
|
|
||
|
|
||
| from odmltables.odml_table import OdmlTable | ||
| from odmltables.odml_csv_table import OdmlCsvTable | ||
| from odmltables.odml_xls_table import OdmlXlsTable | ||
| from odmltables.compare_section_csv_table import CompareSectionCsvTable | ||
| from odmltables.compare_section_xls_table import CompareSectionXlsTable | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All lines from 67-76 should have
src/odmltables/gui/...