Skip to content

Commit 970daa0

Browse files
authored
Merge pull request #969 from opencobra/chore-configuration
Re-organize the package structure and other infrastructure
2 parents 010492a + 087c6a0 commit 970daa0

File tree

175 files changed

+4730
-3731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+4730
-3731
lines changed

.coveragerc

-46
This file was deleted.

.editorconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Editor Configuration (http://editorconfig.org)
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 4
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
max_line_length = 88
12+
13+
[*.{json,yml}]
14+
indent_size = 2
15+
16+
[*.{md,rst}]
17+
trim_trailing_whitespace = false
18+
19+
[Makefile]
20+
indent_style = tab

.github/CONTRIBUTING.rst

+68-104
Original file line numberDiff line numberDiff line change
@@ -3,157 +3,121 @@ Contributing
33
============
44

55
Contributions are welcome, and they are greatly appreciated! Every little bit
6-
helps, and credit will always be given. For issues that contributors have
7-
experienced in the past, see the FAQ at the bottom of this document.
6+
helps, and credit will always be given.
87

98
You can contribute in many ways:
109

11-
Types of Contributions
12-
----------------------
13-
1410
Report Bugs
15-
~~~~~~~~~~~
16-
17-
Report bugs using the `issue tracker <https://github.com/opencobra/cobrapy/issues>`__
11+
===========
1812

19-
If you are reporting a bug, please include:
13+
Report bugs at https://github.com/opencobra/cobrapy/issues.
2014

21-
* Your operating system name and version.
22-
* Your Python and cobrapy version.
23-
* Any details about your local setup that might be helpful in troubleshooting.
24-
* Detailed steps to reproduce the bug.
15+
If you are reporting a bug, please follow the template guide lines. The more
16+
detailed your report, the easier and thus faster we can help you.
2517

2618
Fix Bugs
27-
~~~~~~~~
19+
========
2820

29-
Look through the GitHub `issues <https://github.com/opencobra/cobrapy/issues>`__
30-
for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants
31-
to implement it.
21+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
22+
wanted" is open to whoever wants to implement it.
3223

3324
Implement Features
34-
~~~~~~~~~~~~~~~~~~
25+
==================
3526

36-
Look through the GitHub `issues <https://github.com/opencobra/cobrapy/issues>`__
37-
and `projects <https://github.com/opencobra/cobrapy/projects>`__ for features.
38-
Anything tagged with "enhancement" and "help wanted" is open to whoever wants to
39-
implement it.
27+
Look through the GitHub issues for features. Anything tagged with "enhancement"
28+
and "help wanted" is open to whoever wants to implement it.
4029

4130
Write Documentation
42-
~~~~~~~~~~~~~~~~~~~
31+
===================
4332

4433
cobrapy could always use more documentation, whether as part of the official
45-
cobrapy docs, in docstrings, or even on the web in blog posts, articles, and
46-
such - all contributions are welcome!
34+
documentation, in docstrings, or even on the web in blog posts, articles, and
35+
such.
4736

4837
Submit Feedback
49-
~~~~~~~~~~~~~~~
38+
===============
5039

51-
The best way to send feedback is to file an
52-
`issue <https://github.com/opencobra/cobrapy/issues>`__.
40+
The best way to send feedback is to file an issue at
41+
https://github.com/opencobra/cobrapy/issues.
5342

5443
If you are proposing a feature:
5544

5645
* Explain in detail how it would work.
5746
* Keep the scope as narrow as possible, to make it easier to implement.
58-
* Remember that this is a volunteer-driven project, and that contributions
59-
are welcome :)
60-
61-
If you like cobrapy please remember to 'star' our github page (click on the star
62-
at top right corner), that way we also have an idea of who is using cobrapy!
47+
* Remember that this is a volunteer-driven project, and that contributions are
48+
welcome :)
6349

6450
Get Started!
65-
------------
66-
67-
Want to contribute a new feature or improvement? Consider starting by raising an
68-
issue and assign it to yourself to describe what you want to achieve. This way,
69-
we reduce the risk of duplicated efforts and you may also get suggestions on how
70-
to best proceed, e.g. there may be half-finished work in some branch that you
71-
could start with.
72-
73-
Here's how to set up `cobrapy` for local development to contribute smaller
74-
features or changes that you can implement yourself.
75-
76-
1. Fork the `cobrapy` repository on GitHub.
77-
2. Clone your fork locally::
78-
79-
$ git clone [email protected]:<your Github name>/cobrapy.git
80-
81-
3. Install libglpk using your package manager. For macOS::
82-
83-
$ brew install homebrew/science/glpk
84-
85-
For Debian-based Linux systems (including Ubuntu and Mint)::
86-
87-
$ sudo apt-get install libglpk-dev
88-
89-
4. If virtualenvwrapper is not installed,
90-
`follow the directions <https://virtualenvwrapper.readthedocs.io/en/latest/>`__
91-
to install virtualenvwrapper.
92-
93-
5. Install your local copy of cobrapy into a virtualenv with virtualenvwrapper::
94-
95-
$ cd cobrapy
96-
$ mkvirtualenv cobrapy
97-
98-
Use the ``--python`` option to select a specific version of Python for the
99-
virtualenv. Note on macOS, matplotlib requires Python be installed as a
100-
framework but virtualenv creates a non-framework build of Python. See the
101-
`matplotlib FAQ <http://matplotlib.org/1.5.3/faq/virtualenv_faq.html>`__ for
102-
details on a workaround.
103-
104-
6. Install the required packages for development in the virtualenv using pip install::
51+
============
10552

106-
(cobrapy)$ pip install --upgrade pip setuptools wheel
107-
(cobrapy)$ pip install -r develop-requirements.txt
53+
Ready to contribute? Here's how to set up cobrapy for local development.
10854

109-
If you want to work on the Matlab interface, please also install
110-
``pymatbridge``::
55+
1. Fork the https://github.com/opencobra/cobrapy repository on GitHub. If you
56+
have never done this before, `follow the official guide
57+
<https://guides.github.com/activities/forking/>`_
58+
2. Clone your fork locally as described in the same guide.
59+
3. Install your local copy into a a Python virtual environment. You can `read
60+
this guide to learn more
61+
<https://realpython.com/python-virtual-environments-a-primer/>`_ about them
62+
and how to create one. Alternatively, particularly if you are a Windows or
63+
Mac user, you can also use `Anaconda <https://docs.anaconda.com/anaconda/>`_.
64+
Assuming you have virtualenvwrapper installed, this is how you set up your
65+
fork for local development
11166

112-
(cobrapy)$ pip install pymatbridge
67+
.. code-block:: console
11368
114-
7. Check out the branch that you want to contribute to. Most likely that will be
115-
``devel``::
69+
mkvirtualenv my-env
70+
cd cobrapy/
71+
pip install -e ".[development]"
11672
117-
(cobrapy)$ git checkout devel
73+
4. Create a branch for local development using the ``devel`` branch as a
74+
starting point. Use ``fix``, ``refactor``, or ``feat`` as a prefix
11875

119-
8. Create a branch for local development based on the previously checked out
120-
branch (see below for details on the branching model)::
76+
.. code-block:: console
12177
122-
(cobrapy)$ git checkout -b name-of-your-bugfix-or-feature
78+
git checkout devel
79+
git checkout -b fix-name-of-your-bugfix
12380
12481
Now you can make your changes locally.
12582

126-
9. Setup cobrapy for development::
83+
5. When making changes locally, it is helpful to ``git commit`` your work
84+
regularly. On one hand to save your work and on the other hand, the smaller
85+
the steps, the easier it is to review your work later. Please use `semantic
86+
commit messages
87+
<http://karma-runner.github.io/2.0/dev/git-commit-msg.html>`_.
12788

128-
(cobrapy)$ python setup.py develop
89+
.. code-block:: console
12990
130-
or::
91+
git add .
92+
git commit -m "fix: Your summary of changes"
13193
132-
(cobrapy)$ pip install -e .
94+
6. When you're done making changes, check that your changes pass our test suite.
95+
This is all included with tox
13396

134-
10. When you are done making changes, check that your changes pass pep8
135-
and the tests with tox for your local Python version::
97+
.. code-block:: console
13698
137-
(cobrapy)$ tox -e pep8
99+
tox
138100
139-
and likely one of::
101+
You can run all tests in parallel using detox. To get detox, just pip install
102+
it into your virtualenv.
140103

141-
(cobrapy)$ tox -e py27
142-
(cobrapy)$ tox -e py34
143-
(cobrapy)$ tox -e py35
104+
7. Push your branch to GitHub.
144105

145-
11. Commit your changes and push your branch to GitHub::
106+
.. code-block:: console
146107
147-
(cobrapy)$ git add .
148-
(cobrapy)$ git commit -m "Your detailed description of your changes."
149-
(cobrapy)$ git push origin name-of-your-bugfix-or-feature
108+
git push origin fix-name-of-your-bugfix
150109
151-
12. Submit a pull request through the GitHub website. Once you submit a pull
152-
request your changes will be tested automatically against multiple Python
153-
versions and operating systems. Further errors might appear during those
154-
tests.
110+
8. Open the link displayed in the message when pushing your new branch in order
111+
to submit a pull request. Please follow the template presented to you in the
112+
web interface to complete your pull request.
155113

156-
For larger features that you want to work on collaboratively with other cobrapy team members, you may consider to first request to join the cobrapy developers team to get write access to the repository so that you can create a branch in the main repository (or simply ask the maintainer to create a branch for you). Once you have a new branch you can push your changes directly to the main repository and when finished, submit a pull request from that branch to ``devel``.
114+
For larger features that you want to work on collaboratively with other cobrapy
115+
team members, you may consider to first request to join the cobrapy developers
116+
team to get write access to the repository so that you can create a branch in
117+
the main repository (or simply ask the maintainer to create a branch for you).
118+
Once you have a new branch you can push your changes directly to the main
119+
repository and when finished, submit a pull request from that branch to
120+
``devel``.
157121

158122
Pull Request Guidelines
159123
-----------------------

.github/ISSUE_TEMPLATE.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,29 @@ Please explain:
88

99
#### Code Sample
1010

11-
Create a [minimal, complete, verifiable example](https://stackoverflow.com/help/mcve).
11+
Create a [minimal, complete, verifiable example
12+
](https://stackoverflow.com/help/mcve).
1213

14+
<!-- Paste your code between the ``` tickmarks below or link to a gist. -->
1315
```python
14-
# Paste your code here.
16+
```
1517

18+
<!-- If there was a crash, please include the traceback between the ``` tickmarks below. -->
19+
```
1620
```
1721

18-
#### Actual Output
22+
### Context
1923

20-
#### Expected Output
24+
<!-- Please run the following code and paste the output between the ``` tickmarks below
25+
inside the details block.
2126
22-
#### Dependency Information
27+
python -c "import cobra;cobra.show_versions()"
2328
24-
Please paste the output of `python -c "from cobra import show_versions;
25-
show_versions()"` in the details block below.
29+
-->
2630

2731
<details>
2832

29-
[Paste output here.]
33+
```
34+
```
3035

3136
</details>

.github/PULL_REQUEST_TEMPLATE.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* [ ] fix #(issue number)
2+
* [ ] description of feature/fix
3+
* [ ] tests added/passed
4+
* [ ] add an entry to the [next release](../release-notes/next-release.md)

.github/SUPPORT.rst

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=======
2+
Support
3+
=======
4+
5+
* The mailing list is a good place to ask about general modeling questions.
6+
Please use Google's excellent search capabilities before posting a new
7+
question. By writing a well formulated question, with sufficient detail, you
8+
are much more likely to quickly receive a good answer! Please refer to these
9+
`StackOverflow guidelines <https://stackoverflow.com/help/how-to-ask>`_ on how
10+
to ask questions. `Google Group <http://groups.google.com/group/cobra-pie>`_
11+
* There is the cobrapy `gitter chat <https://gitter.im/opencobra/cobrapy>`_ where
12+
you can ask questions as well. It is a bit more developer-centric than the
13+
mailing list.
14+
* You can post questions in `GitHub issues
15+
<https://github.com/opencobra/cobrapy/issues>`_, too. Please reserve this
16+
channel for code problems and reserve conceptual questions for the mailing
17+
list.

.github/workflows/main.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- devel
8+
pull_request:
9+
branches:
10+
- master
11+
- devel
12+
13+
jobs:
14+
build:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
python-version: [3.6, 3.7, 3.8]
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip setuptools wheel
31+
python -m pip install tox tox-gh-actions
32+
- name: Test with tox
33+
run:
34+
tox -- --cov-report=xml
35+
- name: Report coverage
36+
uses: codecov/codecov-action@v1
37+
with:
38+
fail_ci_if_error: true

0 commit comments

Comments
 (0)