Skip to content

Commit

Permalink
Re-structure packaging. (#151)
Browse files Browse the repository at this point in the history
* Start to re-structure packaging.

* Fix meta.yaml, improve imports of maximize and minimize.

* Update CITATION

Co-Authored-By: Tobias Raabe <[email protected]>

Co-authored-by: Tobias Raabe <[email protected]>
  • Loading branch information
janosg and tobiasraabe authored Mar 17, 2020
1 parent 82005d3 commit 238c860
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 117 deletions.
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion meta.yaml → .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package:
source:
# git_url is nice in that it won't capture devenv stuff. However, it only captures
# committed code, so pay attention.
git_url: .
git_url: ../

build:
noarch: python
Expand All @@ -16,6 +16,9 @@ build:
- estimagic = estimagic.cli:cli

requirements:
build:
- python
- setuptools
host:
- python >=3.6,<3.8

Expand Down
7 changes: 4 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ chronological order. We follow `semantic versioning <https://semver.org/>`_ and
releases are available on `Anaconda.org
<https://anaconda.org/OpenSourceEconomics/estimagic>`_.

x.x.x - YYYY-MM-DD
------------------
0.0.28 - 2020-03-17
-------------------

- :gh:`55` implemented something amazing (:ghuser:`janosg`).
- :gh:`151` estimagic becomes a noarch package. (:ghuser:`janosg`).
- :gh:`150` adds command line interface to the dashboard (:ghuser:`tobiasraabe`)
19 changes: 19 additions & 0 deletions CITATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Please use one of the following samples to cite the estimagic version (change
x.y) from this installation

Text:

[estimagic] estimagic x.y, 2019
Janos Gabler, http://estimagic.readthedocs.io

BibTeX:

@Unpublished{Gabler2019,
Title = {A Python Tool for the Estimation of (Structural) Econometric Models.},
Author = {Janos Gabler},
Year = {2019},
Url = {https://github.com/OpenSourceEconomics/estimagic}
}

If you are unsure about which version of estimagic you are using run: `conda list estimagic`.
27 changes: 27 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# The MANIFEST.in specifies which files are copied over from a temporary directory to
# site-packages after ``pip install``. Examples can be found here:
# https://www.reddit.com/r/Python/comments/40s8qw/simplify_your_manifestin_commands/ and
# https://blog.ionelmc.ro/presentations/packaging.

# Test what is included in the package by running ``python setup.py sdist`` and inspect
# the tarball.

include CHANGES.rst
include CITATION
include LICENSE
include README.rst
include tox.ini
include *.sh
include *.yaml
include *.yml

graft docs
graft estimagic

prune docs/_build
prune docs/getting_started/__tutorial__

global-exclude __pycache__
global-exclude *.py[co]
global-exclude *-checkpoint.ipynb
global-exclude *.ipynb_checkpoints
1 change: 1 addition & 0 deletions docs/source/contributing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Contributing
how-to
styleguide
how-to-add-an-optimizer
releases
63 changes: 63 additions & 0 deletions docs/source/contributing/releases.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Releases
========

What is the new version number?
-------------------------------

The version number depends on the severity of the changes and adheres to `semantic
versioning <https://semver.org/>`_. The format is x.y.z..

You are also allowed to append ``-rc.1`` after the last digit to indicate the first or
higher release candidates. Thus, you can test deployment on PyPI and release preliminary
versions.


How to release a new version?
-----------------------------

1. At first, we can draft a release on Github. Go to
https://github.com/OpenSourceEconomics/estimagic/releases and click on "Draft a new
release". Fill in the new version number as a tag and title. You can write a summary
for the release, but also do it later. Important: Only save the draft. Do not publish
yet.

2. Second, create a final PR to prepare everything for the new version. The
name of the PR and the commit message will be "Release vx.y.z". We need to

- use ``bumpversion part <dev|patch|minor|major>`` to increment the correct part of
the version number in all files.
- update information in ``CHANGES.rst`` to have summary of the changes which
can also be posted in the Github repository under the tag.

3. Run

.. code-block:: bash
$ conda build .
and check whether you can actually build a new version. If you experience errors, fix
them here. Depending on whether you allowed automatic upload to Anaconda, the release
appears under your account. Feel free to delete it.

4. Merge the PR into master.

5. After that, revisit the draft of the release. Make sure everything is fine. Now, you
click on "Publish release" which creates a version tag on the latest commit of the
specified branch. Make sure to target the master branch.

6. Check out the tag in your local repository and run

.. code-block:: bash
$ conda build . --user OpenSourceEconomics
In case automatic upload is disabled, copy the path to the built package and type

.. code-block:: bash
$ anaconda upload <path> --user OpenSourceEconomics
6. Visit `Anaconda.org <https://anaconda.org/OpenSourceEconomics/estimagic>`_ and check
whether the release is available.

7. Spread the word!
12 changes: 2 additions & 10 deletions docs/source/getting_started/ordered_logit_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"import pandas as pd\n",
"from scipy import stats\n",
"from patsy import dmatrices\n",
"from estimagic.optimization.optimize import maximize\n",
"from estimagic import maximize\n",
"from time import sleep"
]
},
Expand Down Expand Up @@ -186,15 +186,7 @@
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Bokeh app running at: http://localhost:46987/\n"
]
}
],
"outputs": [],
"source": [
"info, params = ordered_logit(form, df, dashboard=False)"
]
Expand Down
4 changes: 4 additions & 0 deletions estimagic/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
__version__ = "0.0.28"


from estimagic.optimization.optimize import minimize # noqa: F401
from estimagic.optimization.optimize import maximize # noqa: F401
103 changes: 0 additions & 103 deletions release.py

This file was deleted.

0 comments on commit 238c860

Please sign in to comment.